Difference between revisions of "Templatestyle form field type"

From Joomla! Documentation

(new document)
 
(Add "multiple" and mention fancy-select layout in Joomla 5.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
provides a dropdown list of style options.
+
<noinclude><languages /></noinclude>
 +
<translate><!--T:1-->
 +
Provides a dropdown list of style options.</translate>
  
* '''name''' (mandatory) is the unique name of the parameter.
+
<translate><!--T:2-->
* '''type''' (mandatory) must be ''templatestyle''.
+
* '''name''' (mandatory) is the unique name of the parameter.</translate>
* '''client''' (optional) administrator, defaults to site.
+
<translate><!--T:3-->
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
+
* '''type''' (mandatory) must be ''templatestyle''.</translate>
* '''description''' description text for the form field.
+
<translate><!--T:4-->
* '''class''' (optional) for styling.
+
* '''client''' (optional) administrator, defaults to site.</translate>
 +
<translate><!--T:5-->
 +
* '''label''' (mandatory) (translatable) is the descriptive title of the field.</translate>
 +
<translate><!--T:6-->
 +
* '''description''' description text for the form field.</translate>
 +
<translate><!--T:7-->
 +
* '''class''' (optional) for styling.</translate>
 +
* '''multiple''' <translate>(optional) is whether multiple items can be selected at the same time (''true'' or ''false''). In Joomla 4 it is recommended to use additionally <code>layout="joomla.form.field.groupedlist-fancy-select"</code> in the field declaration (= <code>chosen</code> replacement).</translate>
  
Example XML Definition
+
<translate><!--T:8-->
<source type="xml">
+
Example XML Definition :</translate>
 +
<source lang="xml">
 
<field name="admin_style" type="templatestyle"
 
<field name="admin_style" type="templatestyle"
 
client="administrator"
 
client="administrator"
Line 17: Line 27:
 
</field></source>
 
</field></source>
  
 +
<noinclude>
 +
<translate>
 +
<!--T:9-->
 
[[Category:Standard form field types]]
 
[[Category:Standard form field types]]
 +
</translate>
 +
</noinclude>

Latest revision as of 22:19, 31 January 2022

Other languages:
Deutsch • ‎English • ‎Nederlands • ‎español • ‎français

Provides a dropdown list of style options.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be templatestyle.
  • client (optional) administrator, defaults to site.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description description text for the form field.
  • class (optional) for styling.
  • multiple (optional) is whether multiple items can be selected at the same time (true or false). In Joomla 4 it is recommended to use additionally layout="joomla.form.field.groupedlist-fancy-select" in the field declaration (= chosen replacement).

Example XML Definition :

<field name="admin_style" type="templatestyle"
	client="administrator"
	description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
	label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL" >
		<option value="">JOPTION_USE_DEFAULT</option>
</field>