Archived topic
Feature Request: Element selection on post/page edit screen
10 replies · Started by Andrew on February 21, 2023
I Just had an idea which I assume is not currently possible...
I'd love to have the ability to set an Element so it could be switched on or off on a page/post edit screen - similar to the current 'Disable Elements' section.
eg. My current site has a number of page headers: Standard, Video and Image background. It would be great to have a control on the Page to select which header is to be included. Currently I need to find my desired header in the Elements area, include that, then exclude the page from the default Page header.
Hi there,
takes a little bit of code, but my preferred option here is to use a custom taxonomy to facilitate that.
See my reply here:
https://generatepress.com/forums/topic/display-rules-to-target-page-options/#post-2366988
Good idea, thanks David. I still think it would be a great idea to provide some kind of Element control in the Page Edit screen
You're welcome. It is something we are reviewing, i like the Taxonomy method personally, as it does give users who have a lot of elements to manage, to manage it in their own way :)
Cheers. This build actually has 3 pages of elements .... that's a lot.
I did consider implementing it but would also need to make sure the taxonomy doesn't appear in the slug structure - a complication I don't have time for with this site.
The Element Post Type isn't publicly queryable, so its permalinks should never show, and the wp_sitemaps_taxonomies filter hook will exclude that tax slug from sitemaps, so it should not be found. My tests to date seem to have been ok.
Yeah 3 pages of elements, i don't envy whoever has to maintain that lol
Haha. That would be me :D
Thanks David.
Best of luck then :)

So... right here... it would be great to have an on/off toggle switch. This would then set an exclusion rule for that element for this page/post turning a 5 minute job into a 1 second job and making this usable by my client (end-user) who may not be not entirely tech savvy.
Even better if that could then be integrated with ACF or Meta Box to allow a toggle between a number of elements. eg:
Select
- Header Standard
- Header Image Background
- Header Video Background
We will be undertaking a full review of Conditional Display rules, so we'll see what we can do.
Awesome. Thanks David