if I want to use a Header+Footer parent layout for the majority of my site pages (which are grouped in business areas), and the only thing that changes - depending on the business area - is the header's content (the footer's content is the same for all pages), what's the best way to make the header dynamic?
(UPDATE)
Or an alternative:
to have different parent layouts for each business area, each using the same Footer as an include.
(the title for this post should change to reflect this alternative, didn't see an option for that)
I want to avoid having a different parent layout for each business area, and on top of that the site is bilingual, so any minor change to the footer requires unnecessary duplication in all areas.
If you are using a fully-integrated theme where you can have hierarchical Layouts and you design the header and footer as well as the page content using Layouts, then...
- it is the child Layout that gets assigned, assigned to display single posts of a particular type, archives of such posts, including taxonomy archives etc.
- a child Layout specifies the parent to which it belongs. Any one child Layout can have only one parent Layout, but different child Layouts can have different parents.
So, if your "business areas" are different post types, you can create multiple parent Layouts with different headers (you'll have to reproduce the footer), and can create a child Layout which you assign to one post type and which specifies one parent Layout, and create another child Layout which you assign to a different post type which specifies a different parent.
That's how you display different headers for different kinds of content, and is pretty much the limit of what is possible with "dynamic" headers.
all you said is what I'm already using, my question regards exactly the fact that:
'(you'll have to reproduce the footer)'
Isn't there a workaround for this?
Can't the footer be somehow included in each parent layout, so I can update only 1 footer instead of 10 for each language?
I discussed this with our expert on using Layouts this way with a fully-integrated theme, and he confirmed that it wasn't possible, unless you mix using Layouts this way with an actual footer PHP file, and which implies editing your theme.
He is the author of a sample theme that showcases what is possible with Layouts and an integrated theme, and he touches on this in this issue: hidden link
You might find it instructive to read through the theme files. It is not an official Toolset product, but it is well documented.