I have a content folder containing all my news. I would like to have some sort of scheduled task regularly iterating throgh the folder examining if any news have expired (according to an "EndDate" value on the news).
If the news item has expired I want to copy the item to an "archive folder" and keep the item published.
How I have handled this in the past is not to move articles but just to have seperate macros, one that views current articles and another that selects articles with a EndDate < today.
Best practice on archiving news?
Hi there!
I have a content folder containing all my news. I would like to have some sort of scheduled task regularly iterating throgh the folder examining if any news have expired (according to an "EndDate" value on the news).
If the news item has expired I want to copy the item to an "archive folder" and keep the item published.
Whats the best practice for this action?
/Michael
Hi Michael,
How I have handled this in the past is not to move articles but just to have seperate macros, one that views current articles and another that selects articles with a EndDate < today.
If you want to move to a seperate archive section this could be done through the API and scheduled tasks. Sorry, I don't have any code examples for this. The blog package has code for creating data folders and moving the blog article to the date folder - what you want is similar to this. For scheduling have a look at a package like: http://our.umbraco.org/wiki/reference/packaging/package-actions/community-made-package-actions/add-a-scheduled-task
Cheers
Paul
is working on a reply...