berechar Posted February 3, 2015 Posted February 3, 2015 Hello! I was wondering if it's possible to restrict the selectable pages of a Page Field to the direct children of that page (using a page template containing such a field). What kind of 'selector' would be needed? Something like $page->children()? Kind regards!
berechar Posted February 3, 2015 Author Posted February 3, 2015 hmm, doesn't work unfortunately, it returns an empty list.
adrian Posted February 3, 2015 Posted February 3, 2015 Try: parent=page.children EDIT: Bad idea - see below
Jan Romero Posted February 3, 2015 Posted February 3, 2015 What input type are you using? PageListSelect won’t allow custom selectors or custom PHP code. The Autocomplete input type doesn’t support custom code either. If you put return $page->children; as the custom php, it should totally work. 1
adrian Posted February 3, 2015 Posted February 3, 2015 Yeah - I think Jan Romero's way makes more sense. I actually don't know why Soma's suggestion isn't working. My suggestion loads up a bunch of pages but it doesn't really make any sense because it will actually only find the children of the page's children, which basically means all the grandchildren - oops!
Soma Posted February 3, 2015 Posted February 3, 2015 Ok "page” doesn't work but "page.id" selector: parent=page.id Gives you children of edited page. 2
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