BFD Calendar Posted January 10, 2019 Share Posted January 10, 2019 Can I make a field required based on the template where it's used? Field -> Input -> Required (yes) -> Required only if "template!=people". On www.birthfactdeathcalendar.net I have pages about 'events' that require a 'day', 'month' and 'year' value. They are page reference fields. I use the same fields for 'people' pages to store their birthdates, but since I don't always know them the fields are not required there. If I'm right it only works with a selector "field!=something". Link to comment Share on other sites More sharing options...
louisstephens Posted January 10, 2019 Share Posted January 10, 2019 I believe you are right in thinking that it only works with "field!=something (though please correct me if I am wrong). However, there is this module https://modules.processwire.com/modules/custom-inputfield-dependencies/ that might help you out a bit in your quest. Link to comment Share on other sites More sharing options...
psy Posted January 10, 2019 Share Posted January 10, 2019 When creating the field, set is as not required. Then after adding it to your Events template, edit it to Required on the template. That will make it a required field for only that template. 7 Link to comment Share on other sites More sharing options...
BFD Calendar Posted January 10, 2019 Author Share Posted January 10, 2019 Ah, got that. It wasn't obvious that the field requirement change on the template would only affect the field on that template and not on another. Phew, all those hidden treasures in PW, I could fill a BFD calendar with discovering just those.... 2 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