Joomla XML Standard Field Type – URL

Joomla XML Field Type – URL works in Joomla versions: 2.5 and higher.

Standard field type Joomla XML – URL displays a plain text box into which an electronic link to the page (URL) is entered. The field works with saving any type of URL, including idn – this ensures that any entered email address is saved regardless of the type and environment.

To correctly display the field address in idn format, you need to use the transform function:

				
					JStringPunycode::urlToUTF8($this->contact->webpage)
				
			

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

Joomla 3 XML Standard Field Type - URL

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

Joomla 4 XML Standard Field Type - URL

The code for the URL field from the image in the XML document looks like this:

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

This field supports attributes:

  • name – system name of the field (field identifier).
  • type – the type of the field, in this case «url».
  • 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.
  • 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.
  • default – sets the default value of the field.
  • class – applied CSS field classes. If not specified, the class name «text_area» is used.
  • readonly – sets the field to read-only mode, the value of the field cannot be changed. Variants can be true and false.
  • disabled – makes the field unavailable for editing. The value in the field is not saved. Variants can be true and false.
  • 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.
  • filter – sets the option for filtering data in the field.
  • validate – connects a mask to the field to validate it.
  • relative – if true, then free URLs can be entered.
  • hint – adds a placeholder (hint) to the field.

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