Pod listing
-
Hi,
I have a pod for an event calendar. I have fields like “date_begin” and “date_end”. The field “date_end” is only filled out, if the event lasts for more than one day.
In my template, I use
{@date_begin}[if date_end] until {@date_end}[/if]
so the end date will only show, if the field is filled out. So far, so good.Now on the website, I want to list the events in chronological order, but only, if the event isn’t over yet.
I use the “Where” field with:
CAST(date_begin.meta_value as DATE) BETWEEN CURDATE() and ‘2035/01/01’This will list anything that starts between today and the year 2035.
But that means that events that last longer than one day will also no longer be listed after the first day. So, I need something like “if date_end then cast(date_end.meta_value…) else cast(date_begin.meta_value…)” in my where clause. How do I set this up? Any help appreciated!
Thanks,
Astrid
The topic ‘Pod listing’ is closed to new replies.