Jump to content

Field visibility conditions (only show if parent is...)


a-ok
 Share

Recommended Posts

I'm unsure if this has been answered, or is perhaps in production, but it's not possible to only show a field if it's parent is a certain ID, right? It's field=value not page=value, right? Only reason I ask is more often than not I use the same template/fields for certain pages but sometimes the fields are specific to the page parent being added to so would be nice to have the option.

The only way round this is to create a Page field and have all the fields hidden until they select a 'parent' from the Page field. For example, 'Which fields would you like to use?'.

Link to comment
Share on other sites

Hi, I think what you are looking for is available in the configuration screen of the field. (Under Input > Show this field only if...)

You should be able to specify also the parent condition here (never tested):

parent=123 //or any similar selector for the parent like:
parent=/path/to/parent/  

Hope this helps
 

Link to comment
Share on other sites

Hi, I think what you are looking for is available in the configuration screen of the field. (Under Input > Show this field only if...)

You should be able to specify also the parent condition here (never tested):

parent=123 //or any similar selector for the parent like:
parent=/path/to/parent/  

Hope this helps

Thanks for the reply. Yes, this is what I am using but it doesn't allow for a page field, it seems. Only a field value.

Link to comment
Share on other sites

Thanks all.

I'm wondering if I can use a PageField and set the Selectable Pages (using the PHP options) to the parent page?

return $page->rootParent; return $page->parent;

If this then returned the parent as the default page option then couldn't I then use the following for the Show if?

pagefield=123
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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