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.

Can I use the [if] to stop displaying graphics?

August 19, 2010 1:36pm

Subscribe [2]
  • #1 / Aug 19, 2010 1:36pm

    genehil

    23 posts

    Is it possible to invoke an IF argument to stop the display of a graphic in a template after a certain amount of time?

    On my local television news site - we put a single graphic up with each story we post.  The graphic comes from an Image Gallery as a related entry.

    I would like to delete some of my old graphic out of my gallery and off my server to free up some space.

    But… if I delete a graphic from 2 years ago - but the article it was attached to from two years ago is viewed - I would get the “missing graphic” problem.  The only alternative is to open up each of my hundreds of past articles and “un-relate” each one’s related graphic.

    What I want to do is somehow use the IF argument (or some other PHP argument) to not display story graphic in articles that are more than 180 days old.

    I’m looking for something like this: 
    IF the entry_date is over 180 days in the past - don’t display the related graphic… but IF the entry_date is not yet 180 days in the past - then go ahead and show the related graphic.

    Any thoughts?

    If I can manage this, I can dump countless graphics that are in my gallery at the moment but no longer really needed.

    DISREGARD - I figured it out using some php code I had stashed elsewhere on the site - doing another “timer” job.

  • #2 / Aug 19, 2010 4:55pm

    Ingmar

    29245 posts

    Glad to see you figured it out. Please post again in case there’s anything else.

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

ExpressionEngine News!

#eecms, #events, #releases