Skip Navigation

[Resolved] Best way to use a parent Header+Footer layout with variable Header?

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by nelsonM-2 6 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#1109306

Hello,

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.

thanks.

#1109426

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

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.

#1109441

Hello Nigel,

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?

#1110374

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Not with how hierarchical Layouts work, no.

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.

#1110609

Ok, got it.
I'll give that a try, as soon as I have a chance.
thanks, Nigel!