Question

We are using Tridion 2011 SP1. Is there any way to set up content expiry date for published content. Also if content is expired is there any way to show default content for expired content.

Was it helpful?

Solution

Yes, there are a couple of ways which come to mind to expire content. First you need to create expiry date fields in your content and/or page metadata schemas. The options are:

1) unpublish your expired content using a nightly batch job. This job would scan your content expiry date meta fields, unpublish the expired content and publish default content in its place. You would use the Core Service to connect to Tridion in your batch job app (or Powershell if running the job on the CM server). The disadvantage here is that if you have a lot of content, this can take quite some time to run.

2) keep the expired content published, and have logic in the front end web app to ignore/replace the expired content with default content (e.g. pseudo code [check the Dynamic Delivery API for exact functions]: If date.now < content.metadata.expirydate then show component presentation X, Else show component presentation Y).

OTHER TIPS

I would choose the following approach:

Add Expiry Date metadata to a Component and Page:

  • Exclude any expired Component and Page using a custom resolver.
  • When expiring content is published you can schedule a publish action on the expiry date.
  • Use a Search Folder to search for expired content.

Additionally you can include the expired date as metadata in the published Page, and possible logic to filter expired content.

See my blog for more information: 80.000ft

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top