Modulelayout form field type
From Joomla! Documentation
This page has been superseded and is no longer maintained. Please go to Joomla Manual Modulelayout Field instead
The modulelayout form field type provides a drop down list of all available layouts for a module, grouped by core and template. 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.
- type (mandatory) must be modulelayout.
- name (mandatory) is the unique name of the parameter.
- label (mandatory) (translatable) is the descriptive title of the field.
- description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
Combining following attributes enable you to provide a drop down list of layouts of a specific module.
- module (optional) is a specific module name (e.g. mod_articles_category).
- client_id (optional).
- If 0 (site): Forces searching for layouts only in directories /modules/[MODULENAME]/tmpl/ and all /templates/[TEMPLATENAME]/html/[MODULENAME]/.
- If 1 (administrator): Forces searching for layouts only in directories /administrator/modules/[MODULENAME]/tmpl/ and all /administrator/templates/[TEMPLATENAME]/html/[MODULENAME]/.
- template (optional) is a template name (e.g. protostar or isis). If set forces searching for module template overrides only in this template.
Example XML parameter definition:
<field name="mymodulelayout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
Use Language Constants as Option Values[edit]
The layout values can be translated if a language constant has been defined in the correct format in the module or template.
Within the module language file:
MOD_MYMODULE_LAYOUT_LIST="My Option Label"
The string "My Option Label" is displayed for the file / option "list.php" and not "list".