Expire Posts

Last post 07-08-2008 3:37 PM by Jayme Davis. 5 replies.
Page 1 of 1 (6 items)
  • Expire Posts

    07-07-2008 11:03 AM

    Is there a way to expire posts after a certain date in Graffiti?

  • Re: Expire Posts

    07-07-2008 11:48 AM

    You could use a custom field "Expires On" (datetime) and write some code to check that when the post is loaded.

    Jayme

  • Re: Expire Posts

    07-07-2008 1:26 PM

     

    Jayme Davis:

    You could use a custom field "Expires On" (datetime) and write some code to check that when the post is loaded.

    Jayme

    Thanks for the response.  Could you point me in the way of some code that would accomplish something close to that?

  • Re: Expire Posts

    07-07-2008 1:42 PM

    You can start here: http://graffiticms.com/support/advanced-options/custom-fields/ that will give you a bit to chew on :)

    Jayme

  • Re: Expire Posts

    07-07-2008 1:48 PM

     Thanks for responding.  So do I have to do it in C#?  Is there a way in the template language to go:

     

    if customfield.date > current date {

    display

    }

  • Re: Expire Posts

    07-08-2008 3:37 PM

    See this post: http://support.graffiticms.com/p/164/1798.aspx#1798

    It leverages using a chalk extension to do the check for you - The chalk method could be as simple as passing a date in and returning a bool of greater than today. There is a chalk example link on there.

    Jayme 

Page 1 of 1 (6 items)