Language form field type

From Joomla! Documentation

Revision as of 14:25, 19 August 2015 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
English • ‎Nederlands • ‎español • ‎français

The languages form field type provides a drop down list of the installed languages for the Front-end or Back-end. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. The value saved is the language tag. For example, for English (United Kingdom) this will be 'en-GB'.

Params.language.jpg

The first option on the list is always '- Select Language -' (which is a translatable string) and is given the value 0.

  • type (mandatory) must be language.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • client (mandatory) is the application whose installed languages will be listed. Use site when you want to list the Front-end languages or administrator when you want to list the Back-end languages.
  • default (optional) is the default language tag. For example, 'en-GB'.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.

Example XML parameter definition:

<field name="mylanguage" type="language" client="site" default="en-GB" label="Select a language" description="" />

See also