Jump to content

Recommended Posts

Posted

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!

Posted

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.

  • Like 1
Posted

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!

Posted

Ok "page” doesn't work but "page.id"

selector: parent=page.id

Gives you children of edited page.

  • Like 2

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...