diff --git a/administrator/components/com_fields/forms/field.xml b/administrator/components/com_fields/forms/field.xml index 68becf1523927..71ada60c9546f 100644 --- a/administrator/components/com_fields/forms/field.xml +++ b/administrator/components/com_fields/forms/field.xml @@ -246,6 +246,13 @@ + +
diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index 51a4cde390138..d79cae71acfdd 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -186,6 +186,11 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $node->setAttribute('hint', $field->params->get('hint', '')); $node->setAttribute('required', $field->required ? 'true' : 'false'); + $showon_attribute = $field->params->get('showon', ''); + if ($showon_attribute) { + $node->setAttribute('showon', $showon_attribute); + } + if ($layout = $field->params->get('form_layout')) { $node->setAttribute('layout', $layout); } diff --git a/administrator/language/en-GB/com_fields.ini b/administrator/language/en-GB/com_fields.ini index d98ebb791da75..c77e8eecd3dd2 100644 --- a/administrator/language/en-GB/com_fields.ini +++ b/administrator/language/en-GB/com_fields.ini @@ -59,6 +59,8 @@ COM_FIELDS_FIELD_REQUIRED_LABEL="Required" COM_FIELDS_FIELD_SAVE_SUCCESS="Field saved" COM_FIELDS_FIELD_SHOWLABEL_DESC="Show or Hide the label when the field displays." COM_FIELDS_FIELD_SHOWLABEL_LABEL="Label" +COM_FIELDS_FIELD_SHOWON_DESC="Conditionally show or hide the field depending on the value of other fields." +COM_FIELDS_FIELD_SHOWON_LABEL="Showon Attribute" COM_FIELDS_FIELD_SUFFIX_LABEL="Suffix" COM_FIELDS_FIELD_TYPE_LABEL="Type" COM_FIELDS_FIELD_USE_GLOBAL="Use settings from Plugin"