Top-level templates, which define an entire page, and cartridge templates, which drive the content of individual components, are JSON documents that share the same structure.
Templates can be broken down into four parts:
General information such as the template group, description, and thumbnail image. This information is used in Experience Manager to help the content administrator select the appropriate template for a page or section.
"@description": "${template.description}", "@group": "MainContent", "ecr:createDate": "2016-09-12T17:33:58.542+05:30", "@thumbnailUrl": "thumbnail.png", "ecr:type": "template",
Default content item values.Specify the default name of a cartridge and the default values of properties here.
"defaultContentItem": { "@name": "Results List", "relRankStrategy": "", "recordsPerPage": "10", "sortOption": { "@class": "com.endeca.infront.navigation.model.SortOption", "label": "Most Sales", "sorts": [{ "@class": "com.endeca.infront.navigation.model.SortSpec", "key": "product.analytics.total_sales", "descending": false }] } },
Editor panel definition. These allow you to define the editing interface in Experience Manager for this content item. Properties are generally associated with an editor that enables content administrators to configure the content items that they create within the tool.
"editorPanel": { "editor": "editors/DefaultEditorPanel", "children": [ { "editor": "editors/NumericStepperEditor", "label": "${property.recordsPerPage.label}", "maxValue": 100, "minValue": 10, "propertyName": "recordsPerPage" }, { "editor": "editors/BoostBuryRecordEditor", "buryProperty": "buryStrata", "label": "${property.boostBury.label}", "propertyName": "boostStrata" }, ...CONTENT REMOVED FROM EXAMPLE... ] }
Property type information. In this part of the template, you explicitly declare all the properties of the content item that is described by this template. Property types can include Strings, Lists, and Booleans.
"typeInfo": { "boostStrata": {"@propertyType": "List"}, "buryStrata": {"@propertyType": "List"}, "recordsPerPage": {"@propertyType": "String"}, "relRankStrategy": {"@propertyType": "String"}, "sortOption": {"@propertyType": "Item"} }
By defining the properties in the template along with how they can be configured in the tool, you ensure that the content configured in Experience Manager provides the necessary properties to the corresponding cartridge handler in the Assembler.