Conditionals in templates?
Appologies for a simple “how do I?” post but much has changed since I last played with perch and I wanted to check I was trying to proceed in the best way. Maybe I should just get my hands dirty and see how it pans out but:
I want an editor to be able to add videos to a site and those videos could be an mp4 file, a vimeo link or a youtube link. Is there a way for a template to deal with those options so that I can have a field for “video source” that will handle it without any danger of the editor trying to say, both upload a file AND paste a youtube link?
I had a similar issue when I was thinking about how to design a “projects” page for them. It’s a list/detail situation but sometimes the “detail” is just a link to an external site. I want the template to require either that link OR the detail page (or a checkbox to publish the detail to be ticked, more likely) but not both... can templates do this?
In my second case, the checkbox solves the problem as it will override the link to the external site but the question of what is “required” in the template is still an issue. Can requirement be conditional?
Want to reply to this thread?Login with Perch