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
- Access your Content Manager server and navigate to %TRIDION_HOME%.
- Navigate to the subfolder web\WebUI\Models\SiteEdit\Configuration\.
- Open the file SiteEditModel.config in a plain-text or XML editor.
- Find the
customconfigurationand inside it, theclientconfigurationsubsection. Inside this subsection, you see a number of configurations for Footprints. - Find a
footprintelement 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 thefootprintelements with theirControlIDattribute set to the valueFootprintDropdown. TheIDattribute of this element identifies the Footprint.) - In your SiteEditModel.config file, inside the
footprintelement that you want to change, find the<values>section and insert a new subsection called<groups>inside it, at the top, above the firstvalueelement. Inside it, create agroupsubelement for each group that you want to create in the dropdown or select box, adding anidattribute that you set to a unique identifier string. - Inside each
groupelement, create one or morelabelelements 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
groupssection:<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> - For each
valueelement in thevaluessection, decide which group it belongs to. Specify the group in agroupattribute set to the group's ID. Groups appear in the order in which they are used in thevalueelements.If you omit a
groupattribute, 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 Afghanistanwhere Asien is an item that cannot be selected.
- Save and close SiteEditModel.config.