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
I've set up some default variables in a subtheme of localgov_base called localgov_microsites_base
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
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
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
Microsites Footer is a new region created specifically for blocks that can be placed in that region
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)
I've made a start on this. Some notes:
composer.json
localgov_base
calledlocalgov_microsites_base
variables.css
file, but overridden by getting field values from the host group and printing those values in astyle
attribute on the body viahook_preprocess_html
inlocalgov_microsites_base.theme
hook_preprocess_region
inlocalgov_microsites_base.theme
by creating variables from field values in the host group and using these in theregion--microsites-footer.html.twig
templateMicrosites Footer
is a new region created specifically for blocks that can be placed in that regionpage.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)