Add the announce block to only one section? #4027
-
I am trying to add an announcement to just one docs section. It's a top-level section called "Embed" in the I assume I could make a layout for it that extends main, and then set that layout on every page of the section. But this feels clunky. So I am trying something like this, using the section variable.
However, this ends up with an empty announcement bar everywhere. I have also tried this:
Which ended up with the full announcement everywhere. I suspect section is undefined (was getting that as an error before I added the Edit to add: Also, bizarrely, the block still gets added even when commented out. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for asking. The best idea is to use a dedicated page template which includes the |
Beta Was this translation helpful? Give feedback.
Thanks for asking. The best idea is to use a dedicated page template which includes the
announce
block and set this template for all pages of that section, i.e. all pages that should include the announcement. Adding conditions to templates based on titles might be too unstable.