+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Blogs and Expiration Date

Blogs and Expiration Date

3 posts, 0 answered
  1. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    10 Mar 2008
    Link to this post
    Hi,

    Is there a way to add the expiration date feature to the blogs? We use the expiration date in the News module extensively and would like to use the same functionality in Blogs.

    I know I could perhaps add a meta field to the blogs, but that doesn't change the behavior of the module.

    Thanks!

    Kevin.


  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    10 Mar 2008
    Link to this post
    Hello Kevin Pipher,

    You are on the right track with your idea. You could add the meta field for expiration date, but you'd also need to create a new public control. You could create, let's say, MyBlogPosts control, inherit BlogPosts control and simply override the IMetaSearchInfo[] CreateFilter() function which defines the filter that will be used for displaying posts. So all you need to do in that function is create an array of MetaSearchInfo objects that would specify only to return posts where publication date meta value is greater or equal to today, but whose expiration date meta value (the one you would add) is greater than today.

    On a side note, you can add more filters to this array to achieve some advanced filtering and functionality.

    Let me know if you have additional questions.

    Sincerely yours,
    Ivan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Kevin Pipher
    Kevin Pipher avatar
    91 posts
    Registered:
    30 Nov 2005
    13 Mar 2008
    Link to this post
    Thanks Ivan, I will give this a shot. Seems very simple actually.

    Thanks for the tip
Register for webinar
3 posts, 0 answered