Hey all,
am hoping someone can help me think up a quick fix for this one:
we need to have each entry on our site automatically display an 'expired' text after a pre-specified date (each entry will have a different date for this). Further, I'll need to have the many hundreds of previously posted entries display this now.
Any ideas?
tx
EM
automatic element placed after specified date for each entry
-
- Posts: 1
- Joined: Tue Dec 06, 2011 7:55 am
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: automatic element placed after specified date for each e
Hi!
You can add a custom entryproperty field for each entry where you can enter a date (preferably a unix timestamp, this is easiest to check later on). Give it the name "expirydate" for example
Then in your entries.tpl you can check for something like this:
To also add an expired notice for older entries you could change it to:
Then all entries that do not have this newly added field will also be shown as expired.
Regards,
Garvin
You can add a custom entryproperty field for each entry where you can enter a date (preferably a unix timestamp, this is easiest to check later on). Give it the name "expirydate" for example
Then in your entries.tpl you can check for something like this:
Code: Select all
{if $smarty.now > $entry.properties.ep_expirydate}
<p>This entry is expired.</p>
{/if}
Code: Select all
{if $smarty.now > $entry.properties.ep_expirydate OR $entry.properties.ep_expirydate == ''}
<p>This entry is expired.</p>
{/if}
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/