Apologies for the delay in my reply, guys.
I'm posting a little example that, I think, should help you in solving this issue.
Define a type 'datetime' editable region as follows -
The region above can be left empty if no expiry date applies to a page.
With that in place, we need to simply compare the expiry date set (if at all set) in the region with the current date like this -
I think you can adapt the code to suit your requirements.
Please let me know it helps.
I'm posting a little example that, I think, should help you in solving this issue.
Define a type 'datetime' editable region as follows -
- Code: Select all
<cms:editable name='expiry_date' label='Expiry date' type='datetime' format='mdy'/>
The region above can be left empty if no expiry date applies to a page.
With that in place, we need to simply compare the expiry date set (if at all set) in the region with the current date like this -
- Code: Select all
<cms:set current_date = "<cms:date format='Y-m-d H:i:s' />" />
<cms:if expiry_date && (current_date gt expiry_date) >
<h1>page expired</h1>
<cms:else />
<h1>ok</h1>
</cms:if>
I think you can adapt the code to suit your requirements.
Please let me know it helps.