Joomla category Form Field Type

The category form field type provides a drop down list of categories for a certain extension. This field extends the list field type.

If the show_root attribute is 1, the first option on the list will be a string representing the root category and is given the value 0.

XML Definition

<field name="mycategory" 
type="category"
extension="com_content"
label="Select a category" />

Additional Parameters

extension: (required) This is the name of the extension for which the categories will be retrieved. For example, com_content

scope: It is alias for extension.

show_root: It defines whether to show the root category. The default value is false.

published: It defines whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories.

action: If set, then only categories with appropriate user permissions will be displayed.