J1.5

Difference between revisions of "Usergroup parameter type"

From Joomla! Documentation

(New page: right The usergroups parameter type provides a drop down list of user groups. If the parameter has a value saved, this value is displayed when the page is ...)
 
(This is a parameter, not a form field.)
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Image:Params.usergroups.png|right]]
 
[[Image:Params.usergroups.png|right]]
The usergroups parameter type provides a drop down list of user groups.  If the parameter has a value saved, this value is displayed when the page is first loaded.  If not, the default value (if any) is selected.
 
  
* '''type''' (mandatory) must be ''usergroups''.
+
{{Ambox|type=notice|text=[[Parameter|Parameters]] have been superseded by [[Form field|form fields]] in Joomla! 1.6. You may want to use the corresponding [[Usergroup form field type]].}}
 +
 
 +
The '''usergroup''' parameter type provides a drop down list of user groups.  If the parameter has a value saved, this value is displayed when the page is first loaded.  If not, the default value (if any) is selected.
 +
 
 +
* '''type''' (mandatory) must be ''usergroup''.
 
* '''name''' (mandatory) is the unique name of the parameter.
 
* '''name''' (mandatory) is the unique name of the parameter.
 
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
 
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
 
* '''default''' (optional) is the default user group.  This is the user group ID number.
 
* '''default''' (optional) is the default user group.  This is the user group ID number.
* '''size''' (optional) is the number of rows of the list to display.  If there are more items in the list than the size specified then scroll-bars will appear.  If omitted, the list will be shown as a drop-down list.
+
* '''size''' (optional) is the number of rows of the list to display.  If there are more items in the list than the size specified then scroll-bars will appear.  If there is no size attribute, the list will be shown as a drop-down list if multiple is not set. If multiple is true and no size is set, the default size is the number of items in the list.  
* '''multiple''' (optional) is a Boolean argument. If true then multiple items may be selected from the drop-down list.  If omitted, or false then only one item may be selected. <font color="red">[[[ Note: This option does not currently work. ]]]</font>
+
* '''multiple''' (optional) indicates whether multiple selections are allowed. If the multiple attribute is present (for example, <code>multiple="yes"</code>), then multiple items may be selected from the drop-down list.  If omitted, then only one item may be selected. Note that if multiple is used, the selected values are returned as an array. Also, if multiple is used, you should set the size attribute to control the size of the list box.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''class''' (optional)  is a CSS class name for the HTML form field.  If omitted this will default to 'inputbox'.
 
* '''class''' (optional)  is a CSS class name for the HTML form field.  If omitted this will default to 'inputbox'.
Line 15: Line 18:
 
<noinclude>
 
<noinclude>
 
=== See also ===
 
=== See also ===
* [[Standard parameter types|Full list of standard parameter types]]
+
* [[Standard parameter types|List of standard parameter types]]
</noinclude>
+
[[Category:Standard parameter types]]</noinclude>
[[Category:Templates]]
 

Revision as of 08:57, 21 May 2011

The "J1.5" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Params.usergroups.png

The usergroup parameter type provides a drop down list of user groups. If the parameter has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be usergroup.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default user group. This is the user group ID number.
  • size (optional) is the number of rows of the list to display. If there are more items in the list than the size specified then scroll-bars will appear. If there is no size attribute, the list will be shown as a drop-down list if multiple is not set. If multiple is true and no size is set, the default size is the number of items in the list.
  • multiple (optional) indicates whether multiple selections are allowed. If the multiple attribute is present (for example, multiple="yes"), then multiple items may be selected from the drop-down list. If omitted, then only one item may be selected. Note that if multiple is used, the selected values are returned as an array. Also, if multiple is used, you should set the size attribute to control the size of the list box.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • class (optional) is a CSS class name for the HTML form field. If omitted this will default to 'inputbox'.

Example XML parameter definition:

<param name="myusergroups" type="usergroup" default="" label="Select a user group" description="" />

See also[edit]