Joomla XML Standard Field Type – List

Standard field type Joomla XML – List displays a drop-down list with parameters, or with a list of records. If the field has a saved value, it will be automatically selected from the list after the page is loaded. This field type has several display options.

First display option:

Joomla XML List - Simple Display

Here is a simple type of displaying a drop-down list, its code is as follows:

<field name="mylistvalue" type="list" label="Выберите значение"> <option value="0">Значение 1</option> <option value="1">Значение 2</option> </field>
Code language: YAML (yaml)

Second display option:

Joomla XML List - Multi-select Option

This type of drop-down list allows you to select several values at the same time. The field code is like this:

<field name="mylistvalue" type="list" multiple="true" label="Выберите значение"> <option value="0">Значение 1</option> <option value="1">Значение 2</option> </field>
Code language: YAML (yaml)

Dropdown fields support attributes:

  • name – the system name of the field.
  • type – the type of the field, in this case «list».
  • label – the display name of the field.
  • description – the displayed field description. In Joomla 3, it is displayed as a tooltip when hovering over a field name.
  • default – sets the default value of the field.
  • class – applied CSS field classes.
  • required – sets the attribute of a required field. Possible choices are true and false.
  • mutiple – can be true or false. If true is selected, then multiple values can be selected in the drop-down list at the same time.
  • useglobal – if set to true, then options from the global configuration will be loaded, if any.

For now, that’s all there is to it about the Joomla XML Field Type – List. If we receive new information, it will be added to this article.

Do you need help generating an XML file? Write to us at admin@iws.by and we will help you.

Leave a Reply