J1.5

Difference between revisions of "List parameter type"

From Joomla! Documentation

m (Added more categorisations because this page is generic.)
(Fix red links)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Image:Params.list.jpg|right]]
 
[[Image:Params.list.jpg|right]]
 +
 +
{{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 [[List form field type]].}}
 +
 
The '''list''' parameter type provides a drop down list of custom-defined entries.  If the parameter has a saved value this is selected when the page is first loaded.  If not, the default value (if any) is selected.  
 
The '''list''' parameter type provides a drop down list of custom-defined entries.  If the parameter has a saved value this is selected when the page is first loaded.  If not, the default value (if any) is selected.  
  
Line 9: Line 12:
 
* '''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'.
  
The XML <tt><param></tt> element must include one or more <tt><option></tt> elements which define the list items.  The text between the <tt><option></tt> and <tt></option></tt> tags is what will be shown in the drop down list and is a translatable string.  The <option> tag takes the following argument:
+
The XML <code><param></code> element must include one or more <code><option></code> elements which define the list items.  The text between the <code><option></code> and <code></option></code> tags is what will be shown in the drop down list and is a translatable string.  The <option> tag takes the following argument:
  
 
* '''value''' (mandatory) is the value that will be saved for the parameter if this item is selected.
 
* '''value''' (mandatory) is the value that will be saved for the parameter if this item is selected.
  
Tip: Don't forget to close the parameter definition with <tt></param></tt>.
+
Tip: Don't forget to close the parameter definition with <code></param></code>.
  
 
Example XML parameter definition:
 
Example XML parameter definition:
Line 23: Line 26:
 
<noinclude>
 
<noinclude>
 
=== See also ===
 
=== See also ===
* [[Filelist parameter type]]
+
* [[J1.5:Filelist parameter type|Filelist parameter type]]
* [[Folderlist parameter type]]
+
* [[J1.5:Folderlist parameter type|Folderlist parameter type]]
* [[Imagelist parameter type]]
+
* [[J1.5:Imagelist parameter type|Imagelist parameter type]]
* [[Standard parameter types|Full list of standard parameter types]]
+
* [[J1.5:Standard parameter types|List of standard parameter types]]
[[Category:Components]][[Category:Modules]][[Category:Plugins]][[Category:Templates]][[Category:Development]]</noinclude>
+
</noinclude>
 +
[[Category:Archived version Joomla! 1.5|{{PAGENAME}}]]

Latest revision as of 03:33, 11 June 2013

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.list.jpg

The list parameter type provides a drop down list of custom-defined entries. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

  • type (mandatory) must be list.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default list item value.
  • 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'.

The XML <param> element must include one or more <option> elements which define the list items. The text between the <option> and </option> tags is what will be shown in the drop down list and is a translatable string. The <option> tag takes the following argument:

  • value (mandatory) is the value that will be saved for the parameter if this item is selected.

Tip: Don't forget to close the parameter definition with </param>.

Example XML parameter definition:

<param name="mylistvalue" type="list" default="" label="Select an option" description="">
  <option value="0">Option 1</option>
  <option value="1">Option 2</option>
</param>

See also[edit]