The Spotlight Selection editor uses the Select Records dialog to enable a content administrator to designate specific records to spotlight in a section, or to specify a query to return a dynamic list of records.
Note
The Spotlight Selection editor communicates with the MDEX Engine. In order to enable the editor, ensure that you have enabled communication between Experience Manager and the MDEX Engine.
A Spotlight Selection editor is bound to a
recordSelection
property, which can contain either a
list of record IDs (for featured records) or a set of dimension refinements
(for dynamic records).
To add a Spotlight Selection editor to a template:
Insert an
Item
property of classcom.endeca.infront.cartridge.RecordSpotlightSelection
.In the following
typeInfo
example, this is therecordSelection
property:"typeInfo": { "recordSelection": {"@propertyType": "Item"} }
In the corresponding
defaultContentItem
example, this is the class:"defaultContentItem": { "recordSelection": {"@class": "com.endeca.infront.cartridge.RecordSpotlightSelection"} },
Insert a
String
property that stores the maximum number of records to display in the spotlight.In the following
typeInfo
example, this is themaxNumRecords
property:"typeInfo": { "maxNumRecords": {"@propertyType": "String"}, "recordSelection": {"@propertyType": "Item"}, }
In the corresponding
defaultContentItem
example, this is the maxNumRecords:"defaultContentItem": { "maxNumRecords": "10", "recordSelection": {"@class": "com.endeca.infront.cartridge.RecordSpotlightSelection"} },
Insert a
Boolean
property that controls the display of the "See All" link.In the following
typeInfo
example, this is theshowSeeAllLink
property:"typeInfo": { "maxNumRecords": {"@propertyType": "String"}, "recordSelection": {"@propertyType": "Item"}, "showSeeAllLink": {"@propertyType": "Boolean"}, }
In the corresponding
defaultContentItem
example, this is the showSeeAllLink:"defaultContentItem": { "maxNumRecords": "10", "showSeeAllLink": false, "recordSelection": {"@class": "com.endeca.infront.cartridge.RecordSpotlightSelection"} },
Insert a
String
property to contain the text for the "See All" link.In the following
typeInfo
example, this is theseeAllLinkText
property:"typeInfo": { "maxNumRecords": {"@propertyType": "String"}, "recordSelection": {"@propertyType": "Item"}, "seeAllLinkText": {"@propertyType": "String"}, "showSeeAllLink": {"@propertyType": "Boolean"} }
In the corresponding
defaultContentItem
example, this is the seeAllLinkText:"defaultContentItem": { "@name": "Spotlight Records", "maxNumRecords": "10", "seeAllLinkText": "", "showSeeAllLink": false, "recordSelection": {"@class": "com.endeca.infront.cartridge.RecordSpotlightSelection"} },
Insert an
editors/SpotlightSelectionEditor
element withineditors/DefaultEditorPanel
.Specify label attributes and map the editor to the associated properties:
Attribute Description propertyName
Required. The name of the record selection property that represents the selected records or navigation state. This property must be declared in the same template as the record selection editor. maxNumRecords
Required. Specifies the maximum number of records to display in the spotlight. showSeeAllLink
Required. Controls the display of the "See All" link. seeAllLinkText
Required. Specifies the text for the "See All" link.
The following shows an example of a template that includes a spotlight selection editor:
{ "@description": "${template.description}", "@group": "SecondaryContent", "ecr:createDate": "2016-09-12T17:33:58.290+05:30", "@thumbnailUrl": "thumbnail.png", "ecr:type": "template", "defaultContentItem": { "@name": "Spotlight Records", "maxNumRecords": "10", "seeAllLinkText": "", "showSeeAllLink": false, "title": "Featured Items", "recordSelection": {"@class": "com.endeca.infront.cartridge.RecordSpotlightSelection"} }, "editorPanel": { "editor": "editors/DefaultEditorPanel", "children": [ { "editor": "GroupLabel", "label": "${group.spotlight.label}" }, { "editor": "editors/StringEditor", "propertyName": "title", "label": "${property.title.label}", "enabled": true }, { "editor": "editors/SpotlightSelectionEditor", "maxNumRecords": "maxNumRecords", "propertyName": "recordSelection", "seeAllLinkText": "seeAllLinkText", "showSeeAllLink": "showSeeAllLink", "label": "${property.recordSelection.label}" } ] }, "typeInfo": { "maxNumRecords": {"@propertyType": "String"}, "recordSelection": {"@propertyType": "Item"}, "seeAllLinkText": {"@propertyType": "String"}, "showSeeAllLink": {"@propertyType": "Boolean"}, "title": {"@propertyType": "String"} } }
The spotlight selection editor must be configured with a path to a data service in order to display the Select Records dialog.
Below is
the configuration for the spotlight selection editor in the editor JSON file
for the Discover Electronics reference application, located at
<app
dir>\config\import\editors\SpotlightSelectionEditor\_.json
:
{ "ecr:type":"editor", "config" : { "resourcePath": "/configuration/tools/xmgr/services/endecaBrowserService.json" } }