Actions

Difference between revisions of "Menuitem form field type"

From Joomla! Documentation

(Created page for form field type)
 
 
(One intermediate revision by one user not shown)
Line 3: Line 3:
 
{{Ambox|type=notice|text=In Joomla! 1.5, [[Form field|form fields]] were [[Parameter|parameters]]. For that version, you may want to use the corresponding [[Menuitem parameter type]].}}
 
{{Ambox|type=notice|text=In Joomla! 1.5, [[Form field|form fields]] were [[Parameter|parameters]]. For that version, you may want to use the corresponding [[Menuitem parameter type]].}}
  
The '''menuitem''' form field type provides a drop down list of the available menu items from your Joomla site.  
+
The '''menuitem''' form field type provides a drop down grouped list of the available menu items from your Joomla site.  
 
+
The first option on the list is always '- Select Item -' (which is a translatable string) and is given the value 0.
+
 
+
The first item on the list will always have the ' - Top' (which is a translatable string) appended to it.
+
 
+
 
* '''type''' (mandatory) must be ''menuitem''.
 
* '''type''' (mandatory) must be ''menuitem''.
 
* '''name''' (mandatory) is the unique name of the field.
 
* '''name''' (mandatory) is the unique name of the field.
Line 14: Line 10:
 
* '''default''' (optional) is the default menu item.  Note that this is the ItemID number of the menu item.
 
* '''default''' (optional) is the default menu item.  Note that this is the ItemID number of the menu item.
 
* '''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.
* '''state''' (optional) determines whether all menu items are listed or only published menu items. If state is '0' then all menu items will be listed.  If state is '1' then only published menu items will be listed.
+
* '''published''' (optional) determines whether all menu items are listed or only published menu items. If state is '0' then all menu items will be listed.  If state is '1' then only published menu items will be listed.
 +
 
 +
To add additinal rows with translatable strings (such as "Select" or "Default") add an option to the XML. For example:
 +
<source lang="xml">
 +
<option value="">JDEFAULT</option></source>
  
 
Example XML field definition:
 
Example XML field definition:
 
<source lang="xml"><field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" /></source>
 
<source lang="xml"><field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" /></source>
 
<noinclude>
 
<noinclude>
 +
 
=== See also ===
 
=== See also ===
 
* [[Menu form field type]]
 
* [[Menu form field type]]
 
* [[Standard form field types|List of standard form field types]]
 
* [[Standard form field types|List of standard form field types]]
 
[[Category:Standard form field types]]</noinclude>
 
[[Category:Standard form field types]]</noinclude>

Latest revision as of 02:33, 22 April 2012

Params.menuitem.jpg

The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.

  • type (mandatory) must be menuitem.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • default (optional) is the default menu item. Note that this is the ItemID number of the menu item.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • published (optional) determines whether all menu items are listed or only published menu items. If state is '0' then all menu items will be listed. If state is '1' then only published menu items will be listed.

To add additinal rows with translatable strings (such as "Select" or "Default") add an option to the XML. For example:

<option value="">JDEFAULT</option>

Example XML field definition:

<field name="mymenuitem" type="menuitem" default="45" label="Select a menu item" description="Select a menu item" />


See also