Actions

J1.5

Difference between revisions of "Category parameter type"

From Joomla! Documentation

m (fix problem with quote character in code example)
(Fix red links)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Image:Params.category.jpg|right]]
 
[[Image:Params.category.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 [[Category form field type]].}}
 +
 
The '''category''' parameter type provides a drop down list of published categories from a given section.  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 first option on the list is always '- Select Category -' (which is a translatable string) and is given the value 0.
 
The '''category''' parameter type provides a drop down list of published categories from a given section.  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 first option on the list is always '- Select Category -' (which is a translatable string) and is given the value 0.
  
Line 17: Line 20:
 
<noinclude>
 
<noinclude>
 
=== See also ===
 
=== See also ===
* [[Section parameter type]]
+
* [[J1.5:Section parameter type|Section 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:26, 11 June 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Params.category.jpg

The category parameter type provides a drop down list of published categories from a given section. 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 first option on the list is always '- Select Category -' (which is a translatable string) and is given the value 0.

Note that categories will still be shown in the drop-down list even if the section they belong to is not published. This is to make it possible to build draft content areas without having to first publish a section.

  • type (mandatory) must be category.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • section (optional) is the ID number of the section from which the categories in the list are drawn. The section ID number can be found in the Section Manager. If omitted, all published categories in all sections will be listed.
  • scope (optional) is an alias for section.
  • default (optional) is the default category ID number.
  • 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="mycategory" type="category" label="Select a category" description="" section="3" />

See also