Forums / General / Display Article only for a limited period of time?

Display Article only for a limited period of time?

Author Message

Jan Bengia

Tuesday 02 August 2005 3:16:47 pm

Hi,
maybe I'm just to stupid to find this function: How do I set a publish period of time for a certain content object? I mean something like "this article is on the public site only visible between 03/04/2005 and 03/07/2005 ...? Is this possible?

thanks!
Jan

Arran Price

Wednesday 03 August 2005 4:36:05 pm

Hi Jan,
You cant do this by default. To the best of my understanding,You will need to, either
(for where you want all items having different valid dates) add some new attributes to the item, being start and end dates and then modify the template fetch to exclude items that dont match your criteria, or
(where all items in the folder or whatever have the same dates) modify the template doing the fetch so that it only displays between certain dates.

Hope thats of help

Arran

Jan Bengia

Thursday 04 August 2005 2:25:49 am

Hi,
thanks for the hints - I will try this "workaround". I think this is a real lack of the system ...

vg

Luc Chase

Thursday 04 August 2005 3:48:05 am

Jan,
cronjobs should be in place,
your content class must have a datefield named 'unpublish_date' and the content.ini must have two particular values set.

Both the RootNodeList[] and ClassList[] arrays in content.ini must be defined for it to work. So, you may need to add some settings to your <siteAccess_admin>/content.ini[.append][.php] as follows...

[UnpublishSettings]
RootNodeList[]=2
ClassList[]
ClassList[]=2

Here Articles (class ID 2) are set as a potential unpublish content class, starting at the root of the site ( node 2).
Have a look at the code in cronjobs/unpublish.php (that code refers to 'articleNodeArray' but it works not only on Articles but also for other content classes as long as they have an 'unpublish_date' field of type Date).
NB. that script removes the content rather than just a hide, so look in the Trash to recover it.
If you have not setup cronjobs, just run the command

php -C runcronjobs.php -s siteaccess
from the root of your EZP installation.

Where siteaccess above is the siteacces which contains the content.ini file with the unpublish setup.

Have a look at
http://ez.no/products/ez_publish_cms/documentation/development/extensions/workflow_events/unpublish

For the start/publish date you need to create a workflow that is triggered by a wait for date event.

The Web Application Service Provider