Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Conversation

@andybroomfield
Copy link
Contributor

@andybroomfield andybroomfield commented Oct 21, 2020

Fix #96.

This will replace the footer markup with Drupal regions.

Add 6 footer regions (3 upper and 3 lower).
Use markup same as template to wrap regions

Note: This does not recreate the blocks, so custom blocks will have to be created.

@paulpopus
Copy link
Collaborator

@andybroomfield is the intention to eventually include the blocks as config? I know that we can include config with the theme and it gets pulled in on installation

@andybroomfield
Copy link
Contributor Author

@paulpopus Yes, though whether in the theme or in localgov_core is an open question and if we want to recreate the blocks exactly or have a settings page of the data.

For now the powered by localgov block is part of localgov_core and copyright block can be used for the copyright statement and footer menu for the menu. The rest can just use custom blocks until we can make something configurable.

</div>
</div>
</div>
</nav>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I can't find the closing nav tag :(

@Adnan-cds
Copy link
Contributor

Hi Andy,
The footer solution for the localgov_theme is clearly broken. The info file declares footer_first and footer_second regions whereas footer.html.twig tries to render the non-existent Footer region. If I were fixing this, my approach would be as follows:

  • Declare just one "footer" region and render it in footer.html.twig. Wrap this footer theme variable with necessary markup (e.g. <footer class="row">...{{ page.footer }}...</footer>).
  • Remove all static content from footer.html.twig and turn them into as many blocks as appropriate.
  • Add these blocks to a new module called localgov_blocks. This module can become a submodule of localgov_core although it doesn't have to be.
  • Add the block_class contrib module as a dependency of localgov_blocks.
  • Apply necessary classes (e.g. block--foo, col-lg-3, col-12, etc.) to these blocks from the block config page and then export the block config.
  • Lastly, add these blocks to the Footer region and let Bootstrap arrange them according to their grid-specific classes.

This is quite different from the approach taken in this pull request. So possibly too late but I thought I will bring it to your attention anyway. The rational behind this approach is to keep the layout open to anything that Bootstrap can achieve rather than having multiple regions of fixed width.

Comment on lines +27 to +30
footer_third: "Footer third"
lower_footer_first: "Lower footer first"
lower_footer_second: "Lower footer second"
lower_footer_third: "Lower footer third"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAO @Adnan-cds New footer regions declared here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The footer solution for the localgov_theme is clearly broken.

Hi Andy, I was referring to the current master branch. Sorry, should have been clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

@andybroomfield
Copy link
Contributor Author

  • Declare just one "footer" region and render it in footer.html.twig. Wrap this footer theme variable with necessary markup (e.g. <footer class="row">...{{ page.footer }}...</footer>).
  • Remove all static content from footer.html.twig and turn them into as many blocks as appropriate.
  • Add these blocks to a new module called localgov_blocks. This module can become a submodule of localgov_core although it doesn't have to be.
  • Add the block_class contrib module as a dependency of localgov_blocks.
  • Apply necessary classes (e.g. block--foo, col-lg-3, col-12, etc.) to these blocks from the block config page and then export the block config.
  • Lastly, add these blocks to the Footer region and let Bootstrap arrange them according to their grid-specific classes.

Hi @Adnan-cds thanks for the suggestions. I think we also have to consider this being used by non experinced / first time themers and thats quite a lot just to get started. The soloution here is simmilar to many Drupal themes, like Bootstrap Barrio, which give a fixed set of regions to drop blocks into. If someone was comftable setting up extra modules and block class, they are very likley making a child theme that goes beyond changing colours and fonts and so will override the footer.html.twig template to their exact taste anyway.

I think it would be useful to set some guidance on what we are expecting the base theme to provide and the technical expertise we expect from the people using it. Thoughts from others welcome.

andybroomfield and others added 2 commits October 23, 2020 17:02
Add 6 footer regions (3 upper and 3 lower).
Use markup same as template to wrap regions
@andybroomfield andybroomfield force-pushed the feature/96-footer-blocks branch from 5e23427 to 2c4f6aa Compare October 23, 2020 16:03
@andybroomfield
Copy link
Contributor Author

Merging in the footer regions, Will add new issue in localgov_core to recreate the blocks.

@andybroomfield andybroomfield merged commit 47a7bc0 into master Oct 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the Footer elements to custom blocks

5 participants