Joomla XML Standard Field Type – Color

Field type Joomla XML – Color works in Joomla versions: 2.5 and higher.

Standard field typeJoomla XML – Color adds a text box with a color palette where you can enter a color code or select the desired color from the palette. The data in the field can be filled in several formats.

Option 1: RGB format.

An example of displaying the Color field type (RGB format) in the Joomla 3 admin panel:

Joomla 3 XML Standard Field Type - Color

If you place the cursor in a field, a color selection palette opens next to the field:

Joomla 3 XML Standard Field Type - Color - Active Cursor

An example of displaying the Color field type (RGB format) in the Joomla 4 admin panel:

Joomla 4 XML Standard Field Type - Color

If you place the cursor in a field, a color selection palette opens next to the field:

Joomla 4 XML Standard Field Type - Color - Active Cursor

The Color field code (RGB format) from the image in the XML document looks like this:

				
					<field 
       name="mycolor"
       type="color"
       format="rgb"
       label="Select color" 
       description="Select or enter RGB color."/>
				
			

Option 2: RGBA format.

An example of displaying the Color field type (RGBA format) in the Joomla 3 admin panel:

Joomla 3 Standard Field Type XML - Color - RGBA Format

If you place the cursor in a field, a color selection palette opens next to the field:

Joomla 3 XML Standard Field Type - Color - RGBA Format - Active Cursor

An example of displaying the Color field type (RGBA format) in the Joomla 4 admin panel:

Joomla 4 Standard Field Type XML - Color - RGBA Format

If you place the cursor in a field, a color selection palette opens next to the field:

Joomla 4 XML Standard Field Type - Color - RGBA Format - Active Cursor

The Color field code (RGBA format) from the image in the XML document looks like this:

				
					<field 
       name="mycolor"
       type="color"
       format="rgba"
       label="Select color" 
       description="Select or enter RGBA color."/>
				
			

Option 3: HEX format.

An example of displaying the Color field type (HEX format) in the Joomla 3 admin panel:

Joomla 3 standard field type XML - Color - HEX format

If you place the cursor in a field, a color selection palette opens next to the field:

Joomla 3 Standard Field Type XML - Color - HEX Format - Active Cursor

An example of displaying the Color field type (HEX format) in the Joomla 4 admin panel:

Joomla 4 standard field type XML - Color - HEX format

If you place the cursor in a field, a color selection palette opens next to the field:

Standard field type Joomla 4 XML - Color - HEX format - Active cursor

The Color field code (HEX format) from the image in the XML document looks like this:

				
					<field 
       name="mycolor"
       type="color"
       format="hex"
       label="Select color" 
       description="Select or enter HEX color."/>
				
			

The standard Joomla Color field type supports attributes:

  • name – system name of the field (field identifier).
  • type – field type, in this case «color».
  • default – sets the default value of the field.
  • format – indicates the format of the color in the field, how it will be saved in the settings. Can be rgb, rgba and hex.
  • label – display name of the field.
  • description – the displayed description of the field. In Joomla 3 it is displayed as a tooltip when hovering over a field name.

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