Schedule data items to get published or unpublished at a later time.
Global data types and page data folders in C1 CMS can support publishing. Data items of the types that has no publishing support enabled become publicly available once saved.
With publishing support enabled, saving a data item is not enough to make it public. You have to publish it as you do with CMS Pages.
In C1 CMS version 4.3 or later you can also schedule individual data items to get published and unpublished at the date and time specified. This works in the same manner as with CMS Pages.
Both dynamic and static data types (global data types and page data folders) are supported.
Before you schedule data items to get published / unpublished, make sure that the global data type or page data folder they belong to has its publishing feature enabled:
- From the "Data" perspective, edit a data type.
- Make sure the option "Has publishing" is checked.
- Save the data type.
Static data type interfaces should inherit from
IPublishControlled for the same purpose.
public interface MyCustomDataType : IData, IPublishControlled
- Edit a data item.
- In the "Publication settings" group box, specify the date and time in the "Publish date" field.
- Save the item.
- Edit a data item.
- In the "Publication settings" group box, specify the date and time in the "Unpublish date" field.
- Save and publish the item.
Please not that, if specified, the date and time in the past is ignored, and then removed from the respective field when you reopen the data item.
If a data form has no "Publication settings", please make sure:
- You are using C1 CMS version 4.3 (Build 4.3.5555.25838) or later.
- You are editing an item of a global data type or a page data folder.
- The data type has the publishing option enabled (as described above).
- The data type does not have a dynamic data form associated with it.
If a dynamic data form is in use, consider:
- either deleting it (it can be found below
- or adding the missing elements as shown below:
<cms:bindings> <!-- other bindings --> <cms:binding name="PublicationStatus" type="System.String" /> <cms:binding name="PublicationStatusOptions" type="System.Object" /> <cms:binding name="PublishDate" type="System.DateTime" optional="true" /> <cms:binding name="UnpublishDate" type="System.DateTime" optional="true" /> </cms:bindings> <!-- other markup --> <cms:layout> <!-- other field groups etc --> <FieldGroup Label="Publication settings"> <KeySelector OptionsKeyField="Key" OptionsLabelField="Value" Label="Status" Help="Send the data to another publication status."> <KeySelector.Selected> <cms:bind source="PublicationStatus" /> </KeySelector.Selected> <KeySelector.Options> <cms:read source="PublicationStatusOptions" /> </KeySelector.Options> </KeySelector> <DateTimeSelector Label="Publish date" Help="Specify at which date and time you want the data to be published automatically."> <cms:bind source="PublishDate" /> </DateTimeSelector> <DateTimeSelector Label="Unpublish date" Help="Specify at which date and time you want the data to be unpublished automatically."> <cms:bind source="UnpublishDate" /> </DateTimeSelector> </FieldGroup> </cms:layout>