String properties are very flexible and can be used to specify information such as text to display on a page, URLs for banner images, or meta keywords for search engine optimization.

To add a string property to a template:

The following example shows a variety of string properties:

You add a string editor to enable configuration of string properties. The string editor displays in the Experience Manager interface as a text field or text area depending on the configuration.

String editors enable content administrators to supply arbitrary values for a string property. If you want to constrain the input to a specific enumeration of values, use a choice editor.

To add a string editor to a template:

A choice editor enables the user to select from predefined string values for a property that are presented in a drop-down list. Choice editors affect the value of a string property.

To add a choice editor:

  1. Insert an editors/ChoiceEditor element within editors/DefaultEditorPanel.

  2. Specify additional attributes for the editor:

  3. Insert an choices element within the editors/ChoiceEditor element.

  4. Specify one or more menu options for the choice editor by adding elements that takes the following attributes:

  5. Optionally, set a default value in the corresponding defaultContentItem property.

    For example,:

     "defaultContentItem": {
            "sort": "default",

The following example shows a choice editor configured with a default value.

{
    "@description": "${template.description}",
    "@group": "Navigation",
    "ecr:createDate": "2016-09-12T17:33:58.404+05:30",
    "@thumbnailUrl": "thumbnail.jpg",
    "ecr:type": "template",
    "defaultContentItem": {
        "lessLinkText": "Show Less Refinements...",
        "numRefinements": "10",
        "@name": "Dimension Navigation",
        "dimensionId": "",
        "moreLinkText": "Show More Refinements...",
        "maxNumRefinements": "200",
        "sort": "default",
        "showMoreLink": false,
        "dimensionName": ""
    },
    "editorPanel": {
        "editor": "editors/DefaultEditorPanel",
        "children": [
<!-- additional elements omitted from this example -->
            {
                "editor": "editors/ChoiceEditor",
                "propertyName": "sort",
                "label": "${property.sort.label}",
                "choices": [
                    {
                        "label": "${property.sort.default.label}",
                        "value": "default"
                    },
                    {
                        "label": "${property.sort.static.label}",
                        "value": "static"
                    },
                    {
                        "label": "${property.sort.dynRank.label}",
                        "value": "dynRank"
                    }
                ]
            },
        ]
<!-- additional elements omitted from this example -->
    }
    "typeInfo": {
        "boostRefinements": {"@propertyType": "List"},
        "buryRefinements": {"@propertyType": "List"},
        "dimensionId": {"@propertyType": "String"},
        "dimensionName": {"@propertyType": "String"},
        "lessLinkText": {"@propertyType": "String"},
        "maxNumRefinements": {"@propertyType": "String"},
        "moreLinkText": {"@propertyType": "String"},
        "numRefinements": {"@propertyType": "String"},
        "showMoreLink": {"@propertyType": "Boolean"},
        "sort": {"@propertyType": "String"}
    }
}


Copyright © Legal Notices