All metadata boils down to elements and attributes or fields and values. In the next example, the authors need to attach a ‘Division’ to all the plant topics added to the Encyclopedia. To do this, a metadata field ‘Plant division’ and a set of values is defined in the following way.
Adding a new metafield
Popup the ‘Metadata’ root object’s menu and select ‘New>Metafield’. Enter the field’s description, for example ‘Plant division’ and click ‘OK’.
Adding the metavalues
Next, popup the new field’s menu in the tree and select ‘New>Metavalue’. Enter, for example, ‘Bushes’ as the value. Repeat these steps to add all the required plant divisions.
Setting the metadata attributes
The metadata fields supported by HelpServer fall into the following categories.
Free text: the value can be any string such as a title or the name of an author.
Boolean: the value of a field is either true or false.
Single selection lists: the value can be chosen from a predefined list, such as a status field with one of only 5 possible values.
Multiple selection lists: multiple values can be chosen from a predefined list.
Since the authors can choose only one value from our plant division list, that metafield will be a single selection list. Follow these steps to indicate this in the field’s properties.
Setting the metafield’s attributes
Select the metafield ‘Plant division’ in the tree and click on the ‘Properties’ tab on the right pane.
Expand the ‘More’ item to expose the field’s attributes and select the ‘Listbox’ attribute.
We have also added a second field ‘Project’ to indicate the kind of project we are working on. One of the values is ‘Encyclopedia’. Other values may be added in the future. This field, however, has a limited number of values so it will be a ‘Combobox’, which is a kind of drop-down list box.
Creating a metafield of the type combobox
Indicating a default value
Since ‘Encyclopedia’ is the most common choice for now, we do not want to bother the authors by selecting in when adding new ‘Plant’ topics. In stead, this value should act as the default one. This can be achieved in the following way.
Indicating the default metavalue
Select the metavalue ‘Encyclopedia’ in the tree and click on the ‘Edit’ tab on the right pane.
Select the ‘Default value’ option and click the ‘Save’ button.