{% set inheritedFrom = seomatic.helper.findInheritableBundle(parentBundles, "ogSiteNamePosition") %} {% set hasInheritableValues = inheritedFrom is not null %} {% set additionalVars = { 'isInherited': seomatic.helper.isInherited(metaGlobalVars, "ogSiteNamePosition"), 'fieldLabel': "Facebook OpenGraph Site Name Position Source"|t("seomatic"), 'labelFor': 'metaBundleSettings-siteNamePositionSource', 'wrapperClass': 'seomatic-textSourceWrapper', 'settingName': 'ogSiteNamePosition' } %} {% embed "seomatic/settings/_includes/fields/_inheritableField.twig" with additionalVars %} {% macro ogSiteNamePositionField(textOptions, metaBundleSettings, metaGlobalVars, suffix) %} {% set disabled = suffix|length > 0 %} {% import "_includes/forms" as forms %}
{{ "Where the Site Name is placed relative to the Facebook OpenGraph Title in the <og:title> tag"|t("seomatic") |raw }}
{% namespace "metaBundleSettings" %}
{{ forms.select({ id: "ogSiteNamePositionSource" ~ suffix, name: "ogSiteNamePositionSource", options: textOptions, value: metaBundleSettings.ogSiteNamePositionSource, class: "seomatic-textSourceSelect", errors: metaBundleSettings.getErrors("ogSiteNamePositionSource"), disabled: disabled, }) }}
{% endnamespace %} {% namespace "metaGlobalVars" %}
{{ forms.selectField({ id: "ogSiteNamePosition" ~ suffix, name: "ogSiteNamePosition", options: { before: "Before"|t("seomatic"), after: "After"|t("seomatic"), none: "None"|t("seomatic"), }, value: metaGlobalVars.ogSiteNamePosition, warning: false, errors: metaGlobalVars.getErrors("ogSiteNamePosition"), disabled: disabled, }) }}
{% endnamespace %} {% endmacro %} {% set textOptions = { fromCustom: "Custom Position"|t("seomatic"), } %} {% set textOptions = { sameAsSeo: "Same as Site Name Position"|t("seomatic"), } | merge(textOptions) %} {% if pageContext == "content" %} {% set textOptions = { sameAsGlobal: "Same as Global Facebook OpenGraph Site Name Position"|t("seomatic"), } | merge(textOptions) %} {% endif %} {% block inheritedValues %} {{ _self.ogSiteNamePositionField(textOptions, inheritedFrom.metaBundleSettings ?? metaBundleSettings, inheritedFrom.metaGlobalVars ?? metaGlobalVars, "-inherited") }} {% endblock %} {% block field %} {{ _self.ogSiteNamePositionField(textOptions, metaBundleSettings, metaGlobalVars, "") }} {% endblock %} {% endembed %}