Would be nice to have the option to assign Header/Footer parts to entire site or individual templates using conditions.
Hi @danstanley,
Thanks for bringing this up.
We are planning to have global headers and footers using Global Parts - Fragments, which allow a multitude of template parts + conditions to be applied for each of them.
Great. I was looking into fragments earlier, but didnt grasp it
Our docs are being reworked so apologies for that.
A video will be out soon detailing the fragments.
Basically, you add the template parts of your choice inside a fragment. Then, on your post/template, you can insert a Fragment block (and select the fragment of your choice) which will print out the template parts you selected where the position is selected.
You can apply specific visibility conditions to every template part.
This was initially requested here: Hooks for posts, pages, etc - #5 by Takeru
I am glad to read that because up to now I don’t really understood the difference between fragment and template part (I didn’t digged enough). Thus, the video will be welcome.
Hi @weedor,
Indeed, that’s a good point, there isn’t much of a difference.
The main one is that Fragments won’t disturb your editing of templates if you have a lot of template parts you want to add.
Also, Fragments will be useful if wanting to have template parts appear outside of templates (like the beginning of the body, and end of body).
Partly added in 1.1.5. The last is to introduce template conditions so that the global Header/Footer can be applied to specific templates (when they are in use).