Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Blog - publish on a certain date

$
0
0
Hi!

The Blog package hasn't the built-in scheduled publication feature you are referring to.

The easiest and quickest workaround would be: filtering out the entries older than today's. This means that the blog posts will still be published but invisible because of the applied filter.

For this, you should edit two blog-related Razor functions and change the code a little bit:

Composite / Community / Blog / BlogRenderer.cshtml:
var entries = BlogFacade.GetEntries(IsGlobal).Where (b => b.Date <=  System.DateTime.Now);
Composite / Community / Blog / Latest.cshtml:
var entries = BlogFacade.GetEntries(true).Where(b => b.Date <= System.DateTime.Now).Take(Count);
As this is a quick workaround, it has a few disadvantages to it, though:
  1. The Tag cloud and Archive will behave as if the "future" blog posts are there.
  2. The RSS feed will include the "future" posts, too
  3. The user can access an individual "future" post of he/she know the URL.
So another approach would be: download the blog source code and implement the required feature on one's own :)

You can also create a feature request at https://compositec1.codeplex.com/workitem/list/basic

/Vitaly

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>