For some reason i can't figure this one out. We have deals on our site that are set to expire on certain dates. These deals are sent out via email, so someone could click on a link after the deal has expired. If this happens, we would like to redirect them to the main deals page. My thought was to do this one of two ways:
If the entry is "closed" redirect to {segment_2}. The problem is that expired entries don't automatically change to "closed" status. How would i do this?
Use a conditional statement to either show page or redirect based on expiration date.. something like this:
{exp:channel:entries status="open|featured|homepage|hidden" dynamic="no" limit="1" disable="member_data|trackbacks|categories"} {if expiration_date < current_time} SHOW DEAL {/if} {if expiration_date > current_time} REDIRECT TO {segment_2} {/if} {/exp:channel:entries}
This isn't working either. I did a test with it to just show text based on the condition and both expired pages and live pages showed "SHOW DEAL". Obviously missing something here.
Please let me know if you have any suggestions. Thanks!