Joomla XML Standard Field Type – Radio

Standard field type Joomla XML – Radio displays radio buttons for selecting various options. If the field has a saved value, then it will be automatically selected when the page is loaded. This type of field has several options for displaying data in the form.

The first option for displaying a form field:

Joomla XML Radio - Display Type 1

The field is displayed with simple standard radio buttons. The field code looks like this:

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

The second option for displaying radio buttons looks like this:

Joomla XML Radio - Display Type 2

This type of display is available in Joomla since version 3+. The code for such a field:

<field name="myradiovalue" type="radio" default="0" label="Выберите значение" class="btn-group"> <option value="0">Значение 1</option> <option value="1">Значение 2</option> </field>
Code language: YAML (yaml)

Even with the help of radio buttons, you can implement the response options «Yes» or «No». The field looks like this:

Joomla XML Radio - Display Type 3

This field type also works only in Joomla 3+ version. The code for such a field looks like this:

<field name="myradiovalue" type="radio" default="0" label="Выберите значение" class="btn-group btn-group-yesno"> <option value="1">JYES</option> <option value="0">JNO</option> </field>
Code language: YAML (yaml)

Radio buttons support the following attributes:

  • name – the system name of the field.
  • type – the type of the field, in this case «radio».
  • 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.

For now, that’s all there is to it about the Joomla XML – Radio field type. 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