Configuration

With this generic plugin, we can easily customize the property editing user experiences by providing a property editor plugin based on each document type.

StaticDropdown configuration

In the document namespace, nodetype section, the hipposysedit:type property of your field should be set to StaticDropdown.

In the document namespace, editor section, the 'cluster.options' node of your field should contain a String property 'selectable.options' with a comma-delimited string, defining your static options in the dropdown.

For example, I have the StaticDropdown type node at "/hippo:namespaces/gettingstarted/textpage/editor:templates/_default_/names", and it has a "cluster.options" child node. So, I add a String property named "selectable.options" in the "cluster.options" child node with value "Ard, Arthur".

Example

<sv:node sv:name="cluster.options">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>frontend:pluginconfig</sv:value>
  </sv:property>
  <sv:property sv:name="selectable.options" sv:type="String">
    <sv:value>Static Value 1,Static Value 2,Static Value 3</sv:value>
  </sv:property>
</sv:node>

Note: be aware that the StaticDropdown does not support key/label pairs for separation between submitted (data) values and user interface labels. If you need that, please use the DynamicDropdown.

DynamicDropdown configuration

When using the default value list provider, somewhere in the repository content a document of type 'selection:valuelist' should be set up containing your wanted key/label pairs.

In the document namespace, nodetype section, the property hipposysedit:type of your field should be set to DynamicDropdown.

In the document namespace, editor section, your field should have:

  • property valuelist.provider should be service.valuelist.default (if you're using the default)
  • the valuelist.options node of your field should contain a String property source that points to the value list applicable as an absolute path starting with '/' or a UUID of the valuelist's handle.
  • sorting in 2.02.03 and from 2.05.00 and up: the valuelist.options may contain a property sortComparator that is an full qualified class name of an implementation of org.onehippo.forge.selection.frontend.plugin.sorting.IListItemComparator. The default implementation is org.onehippo.forge.selection.frontend.plugin.sorting.DefaultListItemComparator and sorts alphanumerically. It is parameterized by the optional properties sortOrder (ascending or descending) and sortBy ('key' or 'label')

Example

<sv:property sv:name="model.compareTo" sv:type="String">
  <sv:value>${model.compareTo}</sv:value>
</sv:property>
<sv:node sv:name="cluster.options">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>frontend:pluginconfig</sv:value>
  </sv:property>
  <sv:property sv:name="source" sv:type="String">
    <sv:value>/content/documents/valuelists/valuelist1</sv:value>
  </sv:property>
  <sv:property sv:name="sortComparator" sv:type="String">
    <sv:value>org.onehippo.forge.selection.frontend.plugin.sorting.DefaultListItemComparator</sv:value>
  </sv:property>
  <sv:property sv:name="sortOrder" sv:type="String">
    <sv:value>ascending</sv:value>
  </sv:property>
  <sv:property sv:name="sortBy" sv:type="String">
    <sv:value>label</sv:value>
  </sv:property>
</sv:node>

DynamicMultiSelect configuration

When using the default value list provider, somewhere in the repository content a document of type 'selection:valuelist' should be set up containing your wanted key/label pairs.

In the document namespace, nodetype section, the property hipposysedit:type of your field should be set to String and the property hipposysedit:multiple should be set to true.

In the document namespace, editor section, your field should have:

  • property plugin.class should be org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin (before 2.01.00 use 'org.onehippo.forge.cms.frontend.plugin.DynamicMultiSelectPlugin')
  • property valuelist.provider should be service.valuelist.default (if you're using the default)
  • the valuelist.options node of your field should contain a String property source that points to the value list applicable as an absolute path starting with '/' or a UUID of the valuelist's handle.
  • sorting in 2.04.01: the valuelist.options may contain a property sortComparator that is an full qualified class name of an implementation of org.onehippo.forge.selection.frontend.plugin.sorting.IListItemComparator. The default implementation is org.onehippo.forge.selection.frontend.plugin.sorting.DefaultListItemComparator and sorts alphanumerically. It is parameterized by the optional properties sortOrder (ascending or descending) and sortBy ('key' or 'label')

There are also the following optional properties:

  • property multiselect.type can be selectlist (the default), checkboxes or palette, rendering either a select list control, a list of checkboxes or a palette, a.k.a. shootbox, which consists of two lists with selection arrows between them.
  • property selectlist.maxrows defines the maximum number of rows in your select list control, where the default is 8.
  • property palette.maxrows defines the number of rows of the palette's lists, where the default is 10.
  • property palette.alloworder defines whether or not ordering buttons are shown. The default is 'false'.

Example

<sv:property sv:name="plugin.class" sv:type="String">
  <sv:value>org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin</sv:value>
</sv:property>
<sv:property sv:name="model.compareTo" sv:type="String">
  <sv:value>${model.compareTo}</sv:value>
</sv:property>
<sv:property sv:name="multiselect.type" sv:type="String">
  <sv:value>selectlist</sv:value>
</sv:property>
<sv:property sv:name="selectlist.maxrows" sv:type="String">
  <sv:value>8</sv:value>
</sv:property>
<sv:property sv:name="valuelist.provider" sv:type="String">
  <sv:value>service.valuelist.default</sv:value>
</sv:property>
<sv:node sv:name="valuelist.options">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>frontend:pluginconfig</sv:value>
  </sv:property>
  <sv:property sv:name="source" sv:type="String">
    <sv:value>/content/documents/valuelists/valuelist1</sv:value>
  </sv:property>
</sv:node>