Try our conversational search powered by Generative AI!

Set a rule for a default unpublish value




anyone know if it's possible to configure a default unpublish rule, for example we would like all our news to have a default unpublish date which should occur based on publish date +7 days?

Tried to find this through googling but haven't found a solution, so I thought I'd try here.




Aug 08, 2013 10:43

It's possible to set the StopPublish date when creating a new page se snippet below, so It should be possible to do what you want if you set the date on the publish event.

See this blogpost on how to easy jack into the EPiServer events: 


Set default date when creating new page:

public override void SetDefaultValues(ContentType contentType)
StopPublish = "Your new date";

Aug 08, 2013 11:35

You can do what Per said or you can hook into the publish event and set the stop publish date there as well.  Either one will work.  If you don't want to do it at the model level and want to have more conditions before setting it, I would suggest the publishing event.

Aug 11, 2013 18:27
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.