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. For example, you might use a choice editor to provide sorting options for dimension values in a Guided Navigation cartridge:

To add a choice editor:

  1. Insert an <editors:ChoiceEditor> element within <BasicContentItemEditor>.

  2. Specify additional attributes for the editor:

  3. Specify one or more menu options for the choice editor by adding <choice> elements. <choice> takes the following attributes:

  4. Optionally, set a default value in the corresponding <ContentItem> property.

    For example, to specify the default sort order for a dimension as the default choice for a choice editor with propertyName="sort":

    <Property name="relrank">
    		<!-- Margin Bias -->
            <String>nterms,maxfield,exact,static(product.analytics.conversion_rate,descending)</String>
        </Property>

The following example shows a choice editor configured with a default value. The selected value when the editor is first instantiated is nterms,maxfield,exact,static(product.analytics.conversion_rate,descending), which displays with the label "Margin Bias" in the drop-down menu. Content administrators can select a different sort order.

<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" 
    xmlns:editors="editors"
    xmlns:xavia="http://endeca.com/schema/xavia/2010"
    type="MainContent">
    <!-- additional elements omitted from this example -->
  <ContentItem>  
    <Name>Results List</Name>    
    <!-- additional elements omitted from this example -->
    <Property name="relrank">
		<!-- Margin Bias -->
        <String>nterms,maxfield,exact,static(product.analytics.conversion_rate,descending)</String>
    </Property>
    <!-- additional elements omitted from this example -->
  </ContentItem>
  
  <EditorPanel>
    <BasicContentItemEditor>
      <!-- additional elements omitted from this example -->
      <GroupLabel label="Search Result Settings (apply when user provides search terms)"/>
      <editors:ChoiceEditor propertyName="relrank" label="Relevance ranking">
          <choice label="Margin Bias" value="nterms,maxfield,exact,static(product.analytics.conversion_rate,descending)" />
          <choice label="Inventory Bias" value="nterms,maxfield,exact,static(product.inventory.count,descending)" />
          <choice label="First" value="first" />
          <choice label="By Price (Static)" value="static(product.price)" />
          <choice label="Frequency" value="freq" />
      </editors:ChoiceEditor>
      <!-- additional elements omitted from this example -->
    </BasicContentItemEditor>
  </EditorPanel>
</ContentTemplate>

A radio group editor is similar to the choice editor in that it enables the user to select from predefined string values for a property. The choices are presented as a set of radio button controls.

Although radio buttons are often used for binary choices such as yes/no, the radio group editor can be used for any scenario where the user must specify exactly one value out of a number of options. In order to enable the more general use case, the radio group editor affects the value of a string property.

To add a radio group editor:


Copyright © Legal Notices