Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Accusoft 58 posts 109 karma points
    Jul 19, 2012 @ 21:23
    Accusoft
    0

    Changing PostService.Instance.GetPosts to Only Return Current and Past Posts

    I'm using uBlogsy for a blog setup and I'm trying to setup some blog posts with a future PostDate.  However, they're all showing up.  Is there a way to modify the PostService.Instance.GetPosts service or to tweak the posts and postCount so that it only lists it if the PostDate is current or past?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 25, 2012 @ 16:02
    Anthony Dang
    0

    That's quite a specific bit of logic.

    The you would have to modify GetPosts() and also DoSearch() to exclude posts in the future..

    Is it an option to just have those posts unpublished?

     

     

  • Accusoft 58 posts 109 karma points
    Jul 25, 2012 @ 16:56
    Accusoft
    0

    Anthony - Thank you for the response!

    Unfortunately leaving them unpublished isn't an option.  We plan to write several posts and just schedule them - some of them may go live on a Saturday or in the early morning hours.  

    I don't mind writing the code to modify it and would even happily provide any samples back to the project if it would be useful.  Which files should I modify and deploy and does it have to be done within the C# or can it be done in the Razor code?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 25, 2012 @ 20:50
    Anthony Dang
    0

    You know Umbraco allows your schedule publish events. 

     

    If that's not going to work for you, download the source and modify the post service. It should only be a couple lines of code to filter future nodes.

     

     

Please Sign in or register to post replies

Write your reply to:

Draft