{% set inheritedFrom = seomatic.helper.findInheritableBundle(parentBundles, "seoImageDescription") %} {% set hasInheritableValues = inheritedFrom is not null %} {% set additionalVars = { 'isInherited': seomatic.helper.isInherited(metaGlobalVars, "seoImageDescription"), 'wrapperClass': 'seomatic-textSourceWrapper', 'fieldLabel': "SEO Image Description Source"|t("seomatic"), 'labelFor': 'metaBundleSettings-seoImageDescriptionSource', 'settingName': 'seoImageDescription' } %} {% embed "seomatic/settings/_includes/fields/_inheritableField.twig" with additionalVars %} {% macro seoImageDescriptionField(textOptions, textFieldSources, seomaticConfig, metaBundleSettings, metaGlobalVars, suffix, pageContext) %} {% set disabled = suffix|length > 0 %}

{{ "A text description of the image conveying the essential nature of an image to users who are visually impaired."|t("seomatic") }}

{% import "_includes/forms" as forms %} {% import 'codeeditor/codeEditor' as codeEditor %} {% namespace "metaBundleSettings" %}
{{ forms.select({ id: "seoImageDescriptionSource" ~ suffix, name: "seoImageDescriptionSource", options: textOptions, value: metaBundleSettings.seoImageDescriptionSource, class: "seomatic-textSourceSelect", errors: metaBundleSettings.getErrors("seoImageDescriptionSource"), disabled: disabled, }) }}
{% endnamespace %} {% if textFieldSources is defined and textFieldSources |length %} {% namespace "metaBundleSettings" %}
{{ forms.select({ id: "seoImageDescriptionField" ~ suffix, name: "seoImageDescriptionField", options: textFieldSources, value: metaBundleSettings.seoImageDescriptionField, errors: metaBundleSettings.getErrors("seoImageDescriptionField"), disabled: disabled, }) }}
{% endnamespace %} {% endif %} {% namespace "metaGlobalVars" %}
{% if pageContext != "field" %} {{ codeEditor.textField({ id: "seoImageDescription" ~ suffix, name: "seoImageDescription", value: metaGlobalVars.seoImageDescription, warning: false, errors: metaGlobalVars.getErrors("seoImageDescription"), disabled: disabled, }, "SeomaticExpressionField", {}, {wrapperClass: "monaco-editor-background-frame"}) }} {% else %} {{ forms.textArea({ id: "seoImageDescription" ~ suffix, name: "seoImageDescription", value: metaGlobalVars.seoImageDescription, class: "nicetext", maxlength: seomatic.config.maxDescriptionLength, showCharsLeft: true, warning: false, errors: metaGlobalVars.getErrors("seoImageDescription"), disabled: disabled, }) }} {% endif %}
{% endnamespace %} {% endmacro %} {% set textOptions = { fromCustom: "Custom Text"|t("seomatic"), } %} {% if textFieldSources is defined and textFieldSources |length %} {% set textOptions = { summaryFromField: "Summary From Field"|t("seomatic"), } | merge(textOptions) %} {% set textOptions = { fromField: "From Field"|t("seomatic"), } | merge(textOptions) %} {% endif %} {% block inheritedValues %} {{ _self.seoImageDescriptionField(textOptions, textFieldSources, seomatic.config, inheritedFrom.metaBundleSettings ?? metaBundleSettings, inheritedFrom.metaGlobalVars ?? metaGlobalVars, "-inherited", pageContext) }} {% endblock %} {% block field %} {{ _self.seoImageDescriptionField(textOptions, textFieldSources, seomatic.config, metaBundleSettings, metaGlobalVars, "", pageContext) }} {% endblock %} {% endembed %}