Namita Roy
Namita Roy

Reputation: 265

Using Sitecore publishing agent and publishing an item at specific time

In web.config publishing agent Job is running every 2 minutes. For one item I have added publishing restriction. I have added Publishing from date and time .But the item is getting deleted from web database till that time.

Is this the behavior of sitecore?

Also I tried creating a new version of item and added publishing restriction on that. And it was working as expected. i.e item is not deleted from web database and after specified time it is getting published. Is this solution proper?

Upvotes: 2

Views: 1441

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

Yes, this is how it is supposed to work.

If you specify Publishable From and the Publishable To dates, item will be allowed in web database only between those 2 dates. That means, if you try to publish this item outside that date range, you will in fact unpublish the item. Similarly, if you set only one of those dates or if you clear the Publishable check box.

sitecore - item publishing restrictions

You can specify date ranges for particular item versions as well. In that scenario, Sitecore will only allow in web database the most recent version with either empty publishing restrictions or with publishing restrictions matching actual time.

sitecore - item version publishing restrictions

You can find more information in Sitecore Content Author's Reference and Cookbook, in the Setting up Publishing Restrictions chapter.

Screenshots and cookbook relate to Sitecore 7.2, but it works in the same way in Sitecore 8.

Upvotes: 6

Related Questions