Kodikas Posted February 28 Share Posted February 28 (edited) I might just be overlooking something very simple. But I've had enough now so please help. The following is in my site/ready.php It returns the pages that should be available to select in a PageReferenceField on the page editor. $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->hasField == 'localPage') { $event->return = $event->pages->find('include=hidden'); } }); Now I just can't get it to return the pages I want: Home, all sub pages and their subs and so on, without also getting all the admin pages. And yes I looked at https://processwire.com/docs/selectors/#fields Edited February 28 by Kodikas Link to comment Share on other sites More sharing options...
Robin S Posted February 28 Share Posted February 28 Try "has_parent!=2, include=hidden". If you only need a selector and not more advanced PHP logic then it's simpler to use the "Selector string" option rather than the "Custom PHP code" option. 1 Link to comment Share on other sites More sharing options...
Kodikas Posted February 29 Author Share Posted February 29 That just worked perfectly. Thank you Robin! 1 Link to comment Share on other sites More sharing options...
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