localgovdrupal / localgov_microsites

A repository for the LocalGov Drupal Microsites project.
GNU General Public License v2.0
3 stars 2 forks source link

Prototype footer #27

Closed msayoung closed 2 years ago

markconroy commented 2 years ago

I've made a start on this. Some notes:

  1. I've installed the twig_tweak module, as it makes it easy to load views/blocks/fields/etc from any template. If we stick with this approach we'll need to add this module to our composer.json
  2. I've set up some default variables in a subtheme of localgov_base called localgov_microsites_base
  3. These variables are set in the variables.css file, but overridden by getting field values from the host group and printing those values in a style attribute on the body via hook_preprocess_html in localgov_microsites_base.theme
  4. We have 3 settings available for widths - full width, full width (but with the content aligned in the centre), and same width as the content
  5. This widths section is controlled via hook_preprocess_region in localgov_microsites_base.theme by creating variables from field values in the host group and using these in the region--microsites-footer.html.twig template
  6. Microsites Footer is a new region created specifically for blocks that can be placed in that region
  7. In page.html.twig I have removed regions that we will not be using: header, footer, etc (since we are using new custom regions for these (though I am open to change on this)
markconroy commented 2 years ago

Short blog post/video here about the approach: https://mark.ie/blog/sneak-peak-proof-of-concept-of-customisable-footer-for-a-localgov-drupal-microsite