ContentLanguage form field type

From Joomla! Documentation

This page contains changes which are not marked for translation.
Other languages:
English • ‎Nederlands • ‎español • ‎français
Stop hand nuvola.svg.png
Warning!

This page has been superseded and is no longer maintained. Please go to Joomla Manual ContentLanguage Field instead


Provides a list of content languages.

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be contentlanguage.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • description (optional) (translatable) tooltip for the form field.

Example XML Definition from plugins/system/languagecode/languagecode.php

if ($languages = JLanguage::getKnownLanguages(JPATH_SITE))
{
	// Inject fields into the form
	foreach ($languages as $tag => $language)
	{
		$form->load('
			<form>
				<fields name="params">
					<fieldset
						name="languagecode"
						label="PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL"
						description="PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC"
					>
						<field
							name="'.strtolower($tag).'"
							type="text"
							description="' . htmlspecialchars(JText::sprintf('PLG_SYSTEM_LANGUAGECODE_FIELD_DESC', $language['name']), ENT_COMPAT, 'UTF-8') . '"
							translate_description="false"
							label="' . $tag . '"
							translate_label="false"
							size="7"
							filter="cmd"
						/>
					</fieldset>
				</fields>
			</form>
		');
	}
}