Closed grange85 closed 8 years ago
@sdwilkes , @matt-blair ... didn't we have another place where we wanted to exclude pages from being listed?? I have this vague memory along those lines - and that we implemented some way of doing that???
Maybe I just dreamed that!
The Exec Team page template makes use of the category called 'exclude-from-parent' as we didn't want the meeting minutes to show alongside all the exec team members. It'd mean you'd need to apply it to all the pages you didn't want to appear. I've also used this category on the map to exclude the glossary from appearing on the homepage alongside the continents. If you capture it in a variable, you can then pass it into the 'category_not_in' parameter within the WP query.
The exec team page template is here (see line 27 for the exclusion code) https://github.com/nationalarchives/tna/blob/master/people-index.php
I think this is an option worth trying if others feel it's a good way of doing it? Or we could tweak it to be better if people have other suggestions?
An issue has become clear highlighted by the keepers gallery. The hierarchy looks like this...
The problem is that the pages "Current displays" and "Events" (and their children) aren't actual pages but are used to create content used in the Keeper's Gallery page.
The What's on page shows children (so shows a link to Keeper's Gallery - which is correct) and grandchildren (so shows links to Current displays and Events - which is WRONG).
We need a way to say that this page should never be shown in menus - perhaps a page based custom field that is included in any queries to hide these pages from menus.
Sorry that all seems a bit confused but you can see the magic in action in the Keeper's Gallery box here:
http://livelb.nationalarchives.gov.uk/visit-us/whats-on/