Joomla XML Standard Field Type – Text

Joomla XML field type – Text works in Joomla versions: 2.5 and higher.

Standard field type Joomla XML – Text displays an ordinary one-line text field with the ability to save data of any type. If there is saved data in the field, it will be displayed in the field after the page is loaded. If there is no saved data, the field will try to fill in the data from the default attribute.

An example of displaying the URL field type in the Joomla 3 admin panel:

Joomla 3 XML Standard Field Type - Text

An example of displaying the Text field type in the Joomla 4 admin panel:

Joomla 4 XML Standard Field Type - Text

The code of the Text field from the image in the XML document looks like this:

				
					<field 
       name="mytextvalue"
       type="text"
       label="Enter text" 
       description="Field Description"/>
				
			

This field supports attributes:

  • name – system name of the field (field identifier).
  • type – the type of the field, in this case «text».
  • 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.
  • class – applied CSS field classes. If not specified, the class name «text_area» is used.
  • default – sets the default value of the field.
  • required – sets the attribute of a required field. The form without filling in this field will not be able to be sent. Possible options are true and false.
  • readonly – sets the field to read-only mode, the value of the field cannot be changed. Variants can be true and false.
  • maxlength – sets the maximum number of characters entered.
  • size – the width of the text box in characters. If the field width is not specified, then it takes the value from the user’s browser. This attribute does not limit the number of characters entered.
  • disabled – makes the field unavailable for editing. The value in the field is not saved. Variants can be true and false.
  • hint – adds a placeholder (hint) to the field.
  • autocomplete – disables auto-filling for the field. To disable you need to specify a value for example autocomplete = “off”. To make autocomplete available, just remove this attribute.
  • autofocus – sets autofocus to field after page load.
  • filter – sets the option for filtering data in the field.
  • message – the text of the error message, which will be replaced by the standard error text.
  • inputtype – sets the HTML5 data input type.
  • pattern – regular expression pattern used in data validation.

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

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

Leave a Reply