Forum
using perch:if with date tag
I can't seem to get this to work, even if I remove the date format (it defaults to current date so thought that might be the issue).
I can't seem to get this to work, even if I remove the date format (it defaults to current date so thought that might be the issue).
What are you trying?
Ok, that looks fine. In what way is it failing?
The date still shows on the front-end, I want to be able to control that as not all entries have a date associated.
type="date"
will always have a value, won't it? How would you submit the form without it having a value?Here's what I need to achieve, not sure it's doable!
Basically my template is for educational courses, some of which have course dates and some are TBA.
In the event that there is no associated date, I just need to hide the default date (today) and show TBA or nothing at all.
I know that this can usually be done with <perch:if> and else, but this functionality doesn't seem to work with the date tag.
Do you think this is achievable?
In short, is there a way to make adding a date optional?
You could do a checkbox for TBA
And do a field for the date, and then do your perch:if
Then when you have the date, the content editor can uncheck tba and set the correct date.
Dexter! That worked a treat. Thanks for the contribution :)
Glad it helped :)