Difference between revisions of "Spacer form field type"

From Joomla! Documentation

(Created page for form field type)
 
(Made miscellaneous improvements)
Line 8: Line 8:
 
* '''name''' (mandatory?) is the unique name of the field.
 
* '''name''' (mandatory?) is the unique name of the field.
 
* '''label''' (optional) (translatable) is the text to use as a spacer.
 
* '''label''' (optional) (translatable) is the text to use as a spacer.
* '''hr''' (optional) is whether to display a horizontal rule ('true' or 'false').
+
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 +
* '''hr''' (optional) is whether to display a horizontal rule ('true' or 'false'). If this attribute is 'true', the '''label''' attribute will be ignored.
 
* '''class''' (optional) is a CSS class name for the HTML form field.
 
* '''class''' (optional) is a CSS class name for the HTML form field.
  
Line 24: Line 25:
 
Note that you can also include HTML markup but it must be encoded.  For example, to put the text into bold you can use:
 
Note that you can also include HTML markup but it must be encoded.  For example, to put the text into bold you can use:
 
<source lang="xml"><field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" /></source>
 
<source lang="xml"><field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" /></source>
 +
 +
'''You cannot combine the hr and label attributes.''' To define a spacer with both a horizontal rule and a label, use an encoded <code><nowiki><hr/></nowiki></code> in the '''label''' attribute:
 +
<source lang="xml"><field type="spacer" name="myspacer" label="&lt;hr/&gt;More parameters" /></source>
 
<noinclude>
 
<noinclude>
 
=== See also ===
 
=== See also ===
 
* [[Standard form field types|List of standard form field types]]
 
* [[Standard form field types|List of standard form field types]]
 
[[Category:Standard form field types]]</noinclude>
 
[[Category:Standard form field types]]</noinclude>

Revision as of 16:41, 24 May 2011

Params.spacer.jpg

The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.

  • type (mandatory) must be spacer.
  • name (mandatory?) is the unique name of the field.
  • label (optional) (translatable) is the text to use as a spacer.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • hr (optional) is whether to display a horizontal rule ('true' or 'false'). If this attribute is 'true', the label attribute will be ignored.
  • class (optional) is a CSS class name for the HTML form field.

Example XML field definition:

<field type="spacer" name="myspacer" hr="true" />

You can replace the basic horizontal line with a title which can be used to group parameters. For example,

<field type="spacer" name="myspacer" label="Advanced parameters" />

You can also place translatable text into the label attribute:

<field type="spacer" name="myspacer" class="text"
label="PLG_TINY_FIELD_NAME_EXTENDED_LABEL"
/>

Note that you can also include HTML markup but it must be encoded. For example, to put the text into bold you can use:

<field type="spacer" name="myspacer" label="&lt;b&gt;Advanced parameters&lt;/b&gt;" />

You cannot combine the hr and label attributes. To define a spacer with both a horizontal rule and a label, use an encoded <hr/> in the label attribute:

<field type="spacer" name="myspacer" label="&lt;hr/&gt;More parameters" />

See also[edit]