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?
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?
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?
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?
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?
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.
is working on a reply...