Documentation Center

Organizing options in groups in a dropdown or select box

If your dropdown or select box contains many items, you may want to group them under named headers. For example, if your select box shows countries, you may wish to group them by continent.

Procedure

  1. Access your Content Manager server and navigate to %TRIDION_HOME%.
  2. Navigate to the subfolder web\WebUI\Models\SiteEdit\Configuration\.
  3. Open the file SiteEditModel.config in a plain-text or XML editor.
  4. Find the customconfiguration and inside it, the clientconfiguration subsection. Inside this subsection, you see a number of configurations for Footprints.
  5. Find a footprint element that uses a dropdown or select box control. (You can check which Footprints have this control by opening web\WebUI\Editors\SiteEdit\Configuration\SiteEditEditor.config and finding the footprint elements with their ControlID attribute set to the value FootprintDropdown. The ID attribute of this element identifies the Footprint.)
  6. In your SiteEditModel.config file, inside the footprint element that you want to change, find the <values> section and insert a new subsection called <groups> inside it, at the top, above the first value element. Inside it, create a group subelement for each group that you want to create in the dropdown or select box, adding an id attribute that you set to a unique identifier string.
  7. Inside each group element, create one or more label elements for the localized labels of the groups. These localized labels appear in the dropdown or select box as non-selectable items.

    For example, to make groups that represent continents in both English (default language) and Danish, insert the following groups section:

    <values>
    	<groups>
    		<group id="AsiaGroup">
    			<label>Asia</label>
    			<label lang="1030">Asien</label>
    		</group>
    		<group id="AntarcticaGroup">
    			<label>Antartica</label>
    			<label lang="1030">Antarktis</label>
    		</group>
    		<group id="AfricaGroup">
    			<label>Africa</label>
    			<label lang="1030">Afrika</label>
    		</group>
    		<group id="EuropeGroup">
    			<label>Europe</label>
    			<label lang="1030">Europa</label>
    		</group>
    		<group id="NAmGroup">
    			<label>North America</label>
    			<label lang="1030">Nordamerika</label>
    		</group>
    		<group id="SAmGroup">
    			<label>South America</label>
    			<label lang="1030">Sydamerika</label>
    		</group>
    		<group id="OceaniaGroup">
    			<label>Oceania</label>
    			<label lang="1030">Oceanien</label>
    		</group>
    	</groups>
    <value>
  8. For each value element in the values section, decide which group it belongs to. Specify the group in a group attribute set to the group's ID. Groups appear in the order in which they are used in the value elements.

    If you omit a group attribute, the value remains ungrouped. The localized labels of all ungrouped values will appear at the top of the dropdown.

    For example, if you want to put Afghanistan in the "Asia" group, but you are unsure if Barbados belongs to North America or South America, specify these values as follows:

    <value text="afghanistan" group="AsiaGroup">
    	<label>Afghanistan</label>
    	<label lang="1030">Afghanistan</label>
    </value>
    <value text="barbados">
    	<label>Barbados</label>
    	<label lang="1030">Barbados</label>
    </value>

    In the Danish dropdown or select box, the items will now appear as follows:

    Barbados
    Asien
    	Afghanistan

    where Asien is an item that cannot be selected.

  9. Save and close SiteEditModel.config.