SamC Posted March 10, 2017 Posted March 10, 2017 I've got a page type field which I use to add a custom content block (page) into my page like so (which just has a title and body field): // main.php <?php if ($page->insertContentBlock) { $block = $page->insertContentBlock; } else { $block = $pages->get("/content-blocks/my-services/"); } echo $block->body; ?> I'm after a way of hiding the 'Contact me' block because that is always in the footer and never needs to be added to any other area of the page (or it'll be on their twice). You can see in the first screenshot from the tree hierarchy that the page is hidden... ...but still shows up in this menu when editing a page to add a block... If I unpublish it, then it does not show in the menu, but this seems like a weird solution. To a client, they would just see 'Contact me', greyed out with a line through it, wouldn't make a great deal of sense. Is there something I can put in the 'custom selector to find selectable pages' that will honour the hidden status of this 'Contact me' page? I hope this makes sense. Any advice is appreciated, thanks.
BitPoet Posted March 10, 2017 Posted March 10, 2017 You can use status!=hidden in your selector, so in "Custom selector..." you'd input something like: parent=[id of Content Blocks page], status!=hidden 4
SamC Posted March 10, 2017 Author Posted March 10, 2017 18 minutes ago, BitPoet said: You can use status!=hidden in your selector, so in "Custom selector..." you'd input something like: parent=[id of Content Blocks page], status!=hidden Totally works, you're a gent. Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now