ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Conditional based on expired.

September 22, 2010 1:16pm

Subscribe [3]
  • #1 / Sep 22, 2010 1:16pm

    Chromatic Color

    41 posts

    I am using a mini cal to show day with event on them. And everything works fine. but when an entry expires it is removed from the mini cal.

    I can urn on the show_expired=“yes”, but then because I dont want to show expired entries in the event list it will not show up.

    Is there a was, my guess using a conditional, to have it link to the archiv if the event is expired?

    This is the code I have for non expired entries.

    {if entries}
    
    <td class='{switch}' align='center'><a href="http://{day_path=news_events/events}">{day_number}</a></td>
    
    {/if}
    
    
    
    {if not_entries}
    
    <td class='{switch}' align='center'>{day_number}</td>
    
    {/if}
    
    
    
    {if blank}
    
    <td class='calendarBlank'>{day_number}</td>
    
    {/if}

    My guess is I need something to this effect.

    {if entries}
    
    <td class='{switch}' align='center'><a href="http://{day_path=news_events/events}">{day_number}</a></td>
    
    {/if}
    
    {if expired}
    
    <td class='{switch}' align='center'><a href="http://{day_path=archive/events}">{day_number}</a></td>
    
    {/if}
    
    
    
    {if not_entries}
    
    <td class='{switch}' align='center'>{day_number}</td>
    
    {/if}
    
    
    
    {if blank}
    
    <td class='calendarBlank'>{day_number}</td>
    
    {/if}

    Cheers,

  • #2 / Sep 23, 2010 5:52am

    John Henry Donovan

    12339 posts

    Chromatic Color,

    Try something like this

    {if current_time > {expiration_date}}
    
    <td class='{switch}' align='center'><a href="http://{day_path=archive/events}">{day_number}</a></td>
    
    {/if}
  • #3 / Oct 06, 2012 9:36pm

    Susan

    81 posts

    Thanks for this solution:

    {if current_time > {expiration_date}}

    Exactly what I needed.

  • #4 / Oct 08, 2012 1:21pm

    Shane Eckert

    7174 posts

    Hey Susan,

    How awesome is that? NICE!

    Going to close this older thread off. Oh wow, over a year!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases