a-ok Posted June 1, 2016 Share Posted June 1, 2016 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 More sharing options...
Sebii Posted June 1, 2016 Share Posted June 1, 2016 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 More sharing options...
a-ok Posted June 1, 2016 Author Share Posted June 1, 2016 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 More sharing options...
LostKobrakai Posted June 1, 2016 Share Posted June 1, 2016 parent=page.pagefield should work. At least in the default page editor everything page.x should work. Link to comment Share on other sites More sharing options...
Francesco Bortolussi Posted June 1, 2016 Share Posted June 1, 2016 Hi, maybe you could use the dot operator field.parent_property = value_you_want Link to comment Share on other sites More sharing options...
Sebii Posted June 1, 2016 Share Posted June 1, 2016 Parent might really be a limitation as of few other topics I read trough... Maybe this is the way to go for you, using a hidden field: https://processwire.com/talk/topic/9406-inputfield-dependencies-hide-field-by-path/#entry90591 1 Link to comment Share on other sites More sharing options...
a-ok Posted June 1, 2016 Author Share Posted June 1, 2016 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 More sharing options...
a-ok Posted June 1, 2016 Author Share Posted June 1, 2016 I believe I have this working: https://processwire.com/talk/topic/9406-inputfield-dependencies-hide-field-by-path/?p=121319 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