You can define a section within a template by inserting a
<ContentItem>
or
<ContentItemList>
element within a
<Property>
.
A content item property defines a template section by creating a placeholder for a nested content item defined by a cartridge template.
Content administrators can configure a section in Experience Manager by choosing a cartridge to insert in the section then configuring the properties of the cartridge.
To add a content item property to a template:
Only cartridge templates with a type that matches the section type are presented as options for the content administrator to choose from in Experience Manager. For example, when a content administrator inserts a cartridge in a
RecommendedContent
section, only templates of typeRecommendedContent
display in the Select Cartridge dialog box. (Recall that the cartridge template is the part of a cartridge that is exposed in Experience Manager). Because the type of the section property and cartridge templates must match exactly, the type attribute is also defined as typexs:Name
in the schema and all restrictions that apply to template types also apply to section types.
The following example defines two sections within a template. Note that more than one section in a template can have the same type, as long as your client application expects this kind of content.
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:xavia="http://endeca.com/schema/xavia/2010" xmlns:editors="editors" type="PageTemplate"> <!-- additional elements deleted from this example --> <ContentItem> <Name>New Three-Column Navigation Page</Name> <!-- additional properties deleted from this example --> <Property name="leftColumn"> <ContentItem type="SidebarItem" /> </Property> <Property name="rightColumn"> <ContentItem type="SidebarItem" /> </Property> </ContentItem> <!-- additional elements deleted from this example --> </ContentTemplate>
A content item list allows content administrators to add an arbitrary number of items to a section and to reorder those items within the list using the Content Tree in Experience Manager.
Using content item properties to define the subsections of a cartridge restricts the number of subsections available to the content administrator in Experience Manager. For example, the right column of this page template can contain exactly four cartridges:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:xavia="http://endeca.com/schema/xavia/2010" xmlns:editors="editors" type="PageTemplate"> <!-- additional elements deleted from this example --> <ContentItem> <Name>New Three-Column Navigation Page</Name> <!-- additional elements deleted from this example --> <Property name="rightColumn1"> <ContentItem type="SidebarItem" /> </Property> <Property name="rightColumn2"> <ContentItem type="SidebarItem" /> </Property> <Property name="rightColumn3"> <ContentItem type="SidebarItem" /> </Property> <Property name="rightColumn4"> <ContentItem type="SidebarItem" /> </Property> </ContentItem> <!-- additional elements deleted from this example --> </ContentTemplate>
Although some of the sections can be left empty, no more than four cartridges can be added to the right column.
Using a content item list removes the restriction and allows the content administrator to add an arbitrary number of content items to the right column of the page:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:xavia="http://endeca.com/schema/xavia/2010" xmlns:editors="editors" type="PageTemplate"> <!-- additional elements deleted from this example --> <ContentItem> <Name>New Three-Column Navigation Page</Name> <!-- additional elements deleted from this example --> <Property name="rightColumn"> <ContentItemList type="SidebarItem" /> </Property> </ContentItem> <!-- additional elements deleted from this example --> </ContentTemplate>
To add a content item list to a template:
Insert a
<ContentItemList>
element inside a<Property>
element.Only cartridge templates with a type that matches the content item list type are presented as options for the content administrator to choose from in Experience Manager. In the above example, when a content administratorinserts a cartridge in a
RightColumn
section, only templates of typeSidebarItem
display in the Select Cartridge dialog box.Optionally, specify a maximum number of content items using the
maxContentItems
attribute.For example:
<Property name="RightColumn"> <ContentItemList type="SidebarItem" maxContentItems="4"/> </Property>
By default, the value of
maxContentItems
is0
, which means that there is no limit to the number of cartridges that can be added to a content item list.
Unlike other types of content properties, section properties are always editable; you do not need to explicitly specify an editor in the template.
In Experience Manager, content administrators can select cartridges to insert in sections either by clicking the cartridge Add button in the content detail panel or by right-clicking the section in the Content Tree. Both options bring up the cartridge selector dialog box and are enabled automatically when you define a section in the template.