Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
I have a editable field called end_date. Promotional banners after this date must no longer show.

How can I prevent promotional banners from not showing after the end_date in a programmed manner. My thoughts are;

Code: Select all
<cms:if end_date  gt <cms:php> date(); </cms:php> >
    <!-- banner does not show -->
<cms:else />
   <!-- display banner -->
</cms:if>


Can somebody please help out.

Thanks.
Hi,

Assuming your 'end_date' editable region is of type 'datetime', you can do a straight comparison of its value with the current date outputted in the matching format (as in the following example) -
Code: Select all
<cms:if end_date gt "<cms:date format='Y-m-d H:i:s' />" >
    <!-- banner does not show -->
<cms:else />
   <!-- display banner -->
</cms:if>

Hope this helps.
Wow KK, this is awesome.

Love the way the tags work. Your solution worked like a charm.

Thanks alot once again.
You are welcome, Harris :)
4 posts Page 1 of 1