J1.5:Category parameter 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.
[[[ Note: At present this does not check if the section is published (only the categories). See tracker #12256. ]]]
- 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" />