Attaches an IPresentationTemplate to the Data Entry Template.
null. The template text of the attached Presentation Template will be used to determine the layout of the published content items created with this Data Entry Template. The attachment will not be persisted until Store is called. A Presentation Template can only be attached to one Data Entry Template at a time, and similarily, a Data Entry Template can have only one Presentation Template attached at a time. Calling this method when the Data Entry Template already has a Presentation Template attached will result in an InvalidOperationException.
InvalidOperationException will be thrown when Store is called on the Data Entry Template. In order to change the attached Presentation Template, call DetachPresentationTemplate, Store, then AttachPresentationTemplate. The Data Entry Template must be persisted after calling DetachPresentationTemplate, before attaching a different Presentation Template or an InvalidOperationException will be thrown. This method must be called prior to IContentItemManager.PublishContentItem, because when an IContentItem of a particular IDataEntryTemplate is published, the layout of the published item will be determined by the template text of the IPresentationTemplate attached to the item's Data Entry Template.
| Exception Type | Condition |
|---|---|
| InvalidOperationException | The Data Entry Template has already been removed, or the Data Entry Template has already been attached with a different Presentation Template, or the Presentation Template has already been removed. |
IDataEntryTemplate Interface | Plumtree.Remote.PRC.Content.DataEntryTemplate Namespace