Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi all,

I have an event date showing on my event pages and some events span into another month, for example October 30 - November 2. I was wondering if using CMS:if I can make it only show the second month if it goes into another month. So if the entire event was in October, it would show as October 15-17 instead of October 15 - October 17.

To capture the information in the clonable template I am using two fields, one for start_date and another for end_date. i am also using the date picker and then displaying the fields like this

Code: Select all
<cms:date start_date format='F j' /> - <cms:date end_date format='F j' />


So somehow I would like to say, if the end_date month is the same as the start_day month then show
Code: Select all
<cms:date end_date format='j' />


else if end_date month is not equal to start_date month then show
Code: Select all
<cms:date end_date format='F j' />
(notice the different"format")

I know this must be possible, just can't seem to hit on the right syntax to make it so.
Try this -
Code: Select all
<cms:set start_month="<cms:date start_date format='F' />" />
<cms:set end_month="<cms:date end_date format='F' />" />

<cms:if start_month=end_month>
    <cms:date end_date format='j' />
<cms:else />
    <cms:date end_date format='F j' />
</cms:if>

Does it help?
KK,

Genius once again. Thank you so much, this worked perfectly!
3 posts Page 1 of 1