SF 4.1 Blog Publish Date
Hi
I created a small sitefinity site for my sons blog.
Now i want to manually migrate his postings to the new blog.
How can I set manually the publish date ?
in SF3 there was a box to set the public post date, but i can't find anythin in SF 4.
Hello Boas,
You have to use the fluent or standard API.
www.sitefinity.com/.../sitefinity-essentials-modules-blogs.html
After the item is created, you need to get it for editing and set the PublicationDate property.
sample
protected
void
SetPublicationDate()
var fluent = App.WorkWith();
//set publication date
var publicationDate = DateTime.UtcNow.AddDays(-10).AddYears(-2);
//get the required blog
var post = fluent.BlogPosts().Where(p => p.Title ==
"fda"
).First();
post.CheckOut()
.Do(n => n.PublicationDate = publicationDate; )
.CheckIn()
.Publish()
.Do(n => n.PublicationDate = publicationDate; )
.SaveChanges();
Cool thanks
is it a bad idea to just send an SQL Update comman to the SQL Server ?
Hello Boas,
I suggest that you should use the API , because of the relations to many tables.
All the best,
Ivan Dimitrov
the Telerik team
would this same thing need to be done with the news items and when they are published? for instance we use news items and set some of them to a category called press releases. the problem i see is when i added about 30 manually in the same day they all have that publish date and i cannot easily change it.
3.7 had a feature to edit this portion...will this be included anytime soon?
Hi Brandon,
The same applies for news. I know that there was UI in 3.x and this is why we logged a task for extending Sitefinity 4.0 UI with fields that will allow you to change the PublicationDate value.
Greetings,
Ivan Dimitrov
the Telerik team