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

{{ "X (Twitter) descriptions are displayed below the X (Twitter) Title in your X (Twitter) Cards. Use them to provide a summary of what your page is about."|t("seomatic") }}

{% import "_includes/forms" as forms %} {% import 'codeeditor/codeEditor' as codeEditor %} {% namespace "metaBundleSettings" %}
{{ forms.select({ id: "twitterDescriptionSource" ~ suffix, name: "twitterDescriptionSource", options: textOptions, value: metaBundleSettings.twitterDescriptionSource, class: "seomatic-textSourceSelect", errors: metaBundleSettings.getErrors("twitterDescriptionSource"), disabled: disabled, }) }}
{% endnamespace %} {% if textFieldSources is defined and textFieldSources |length %} {% namespace "metaBundleSettings" %}
{{ forms.select({ id: "twitterDescriptionField" ~ suffix, name: "twitterDescriptionField", options: textFieldSources, value: metaBundleSettings.twitterDescriptionField, errors: metaBundleSettings.getErrors("twitterDescriptionField"), disabled: disabled, }) }}
{% endnamespace %} {% endif %} {% namespace "metaGlobalVars" %}
{% if pageContext != "field" %} {{ codeEditor.textField({ id: "twitterDescription" ~ suffix, name: "twitterDescription", value: metaGlobalVars.twitterDescription, warning: false, errors: metaGlobalVars.getErrors("twitterDescription"), disabled: disabled, }, "SeomaticExpressionField", {}, {wrapperClass: "monaco-editor-background-frame"}) }} {% else %} {{ forms.textArea({ id: "twitterDescription" ~ suffix, name: "twitterDescription", value: metaGlobalVars.twitterDescription, class: "nicetext", maxlength: 200, showCharsLeft: true, warning: false, errors: metaGlobalVars.getErrors("twitterDescription"), 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 %} {% set textOptions = { sameAsSeo: "Same as SEO Description"|t("seomatic"), } | merge(textOptions) %} {% block inheritedValues %} {{ _self.twitterDescriptionField(textOptions, textFieldSources, inheritedFrom.metaBundleSettings ?? metaBundleSettings, inheritedFrom.metaGlobalVars ?? metaGlobalVars, "-inherited", pageContext) }} {% endblock %} {% block field %} {{ _self.twitterDescriptionField(textOptions, textFieldSources, metaBundleSettings, metaGlobalVars, "", pageContext) }} {% endblock %} {% endembed %}