A property can consist of a collection of properties (key-value pairs) of any valid type.
Because item properties can be used for a variety of purposes, Experience Manager does not include any generic editors for working with items. However, editors intended for specific purposes may store their values in item properties.
To add an item property to a template:
In
typeInfosection, insert anItemelement inside a@propertyTypeelement."typeInfo": { "sortOption": {"@propertyType": "Item"} }In
defaultContentItemInsert, add asortOptionelement with asortselement and specify the@classattribute with the fully qualified class name of the configuration model class that corresponding to this item property."defaultContentItem": { "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 }] } }Optionally, specify other attributes within the
sortOptionelement.
Following is an example of a template that uses an item:
{
"@description": "${template.description}",
"@group": "MainContent",
"ecr:createDate": "2016-09-12T17:33:58.542+05:30",
"@thumbnailUrl": "thumbnail.png",
"ecr:type": "template",
"defaultContentItem": {
"@name": "Results List",
"relRankStrategy": "",
"boostStrata": [],
"buryStrata":[],
"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
}]
}
},
<!-- additional elements omitted from this example -->
"typeInfo": {
"boostStrata": {"@propertyType": "List"},
"buryStrata": {"@propertyType": "List"},
"recordsPerPage": {"@propertyType": "String"},
"relRankStrategy": {"@propertyType": "String"},
"sortOption": {"@propertyType": "Item"}
}
