Jonathan Lahijani Posted July 16, 2015 Share Posted July 16, 2015 I'm not sure if this has been brought up before, and I definitely know this idea is very wishful thinking since it goes directly against how ProcessWire is supposed to work, but I thought I'd bring it up anyway. Currently, if you want to add a field to a page, you must add that field to the template that the page uses. This means, the field will exist not only for that specific page, but any pages that use the same template. Sometimes however, I want to add a field to a specific page without having to give that page a unique template. Perhaps I'm a little lazy, or perhaps it just seems like creating a specific template feels like overkill, although that is the ProcessWire Way. If you are familiar with Advanced Custom Fields for WordPress, it does have this kind of functionality (in addition to a few other cool ways to assign fields), but WordPress of course handles custom fields in a much more "loose" way. Any thoughts on this? 1 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted July 16, 2015 Author Share Posted July 16, 2015 I do realize you can use a field's visibility settings to achieve this quite well, but are there performance or overhead issues with this approach? Link to comment Share on other sites More sharing options...
thetuningspoon Posted July 16, 2015 Share Posted July 16, 2015 As long as the field isn't set to "autojoin", there would be no performance/overhead issue at all, I don't think. Is it possible to use visibility settings to show a field on a specific page? 1 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted July 16, 2015 Author Share Posted July 16, 2015 Is it possible to use visibility settings to show a field on a specific page? Yes. Scenario 1: Let's say you want to show a field on all pages that are the child of a certain page. In the visibility settings put: parent_id=id-of-parent-page-here Scenario 2: Let's say you want to show a field on a specific page. In the visibility settings put: id=id-of-page-here 3 Link to comment Share on other sites More sharing options...
thetuningspoon Posted July 16, 2015 Share Posted July 16, 2015 Neat. You learn something new about ProcessWire every day 1 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted August 4, 2015 Author Share Posted August 4, 2015 Scenario 1: Let's say you want to show a field on all pages that are the child of a certain page. In the visibility settings put: parent_id=id-of-parent-page-here I think this broke with 2.6.11? Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted August 18, 2015 Author Share Posted August 18, 2015 I think this broke with 2.6.11? It's now fixed, but a config option must be enabled: https://github.com/ryancramerdesign/ProcessWire/issues/1321#issuecomment-131525655 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