diff --git a/src/templates/_components/fields/SeoField_input.twig b/src/templates/_components/fields/SeoField_input.twig index 709d555..08e313b 100644 --- a/src/templates/_components/fields/SeoField_input.twig +++ b/src/templates/_components/fields/SeoField_input.twig @@ -22,12 +22,9 @@ {% endif %} {% if field.tabs.facebook %} {% set tabSelected = false %} - {% include 'seo-fields/_components/fields/_tabs/_facebook.twig' with { tabSelected : tabSelected} %} - {% endif %} - {% if field.tabs.twitter %} - {% set tabSelected = false %} - {% include 'seo-fields/_components/fields/_tabs/_twitter.twig' with { tabSelected : tabSelected} %} + {% include 'seo-fields/_components/fields/_tabs/_social.twig' with { tabSelected : tabSelected} %} {% endif %} + {% if (field.tabs.advanced is defined and field.tabs.advanced) %} {% set tabSelected = false %} {% include 'seo-fields/_components/fields/_tabs/_advanced.twig' with { tabSelected : tabSelected} %} diff --git a/src/templates/_components/fields/SeoField_settings.twig b/src/templates/_components/fields/SeoField_settings.twig index d1e7369..8135249 100644 --- a/src/templates/_components/fields/SeoField_settings.twig +++ b/src/templates/_components/fields/SeoField_settings.twig @@ -29,19 +29,12 @@ }) }} {{ forms.lightswitchField({ - label: "Show Facebook Tab"|t("seo-fields"), + label: "Show Social Media Tab"|t("seo-fields"), id: "showFacebookTab", name: "tabs[facebook]", on: field.tabs|length ? field.tabs.facebook : 1, }) }} - {{ forms.lightswitchField({ - label: "Show Twitter Tab"|t("seo-fields"), - id: "showTwitterTab", - name: "tabs[twitter]", - on: field.tabs|length ? field.tabs.twitter : 1, - }) }} - {{ forms.lightswitchField({ label: "Show advanced tab"|t("seo-fields"), id: "showAdvancedTab", diff --git a/src/templates/_components/fields/_tabs/_facebook.twig b/src/templates/_components/fields/_tabs/_social.twig similarity index 91% rename from src/templates/_components/fields/_tabs/_facebook.twig rename to src/templates/_components/fields/_tabs/_social.twig index 7294c35..e858d55 100644 --- a/src/templates/_components/fields/_tabs/_facebook.twig +++ b/src/templates/_components/fields/_tabs/_social.twig @@ -1,7 +1,7 @@ {% import "_includes/forms" as forms %} - +
@@ -25,7 +25,7 @@
{{ forms.textField({ - label: "Facebook OG title"|t("seo-fields"), + label: "Social Media title"|t("seo-fields"), id: name ~ "-facebookTitle", name: name ~ "[facebookTitle]", value: value.facebookTitle, @@ -34,7 +34,7 @@
+ for="{{ name ~ "-facebookDescription" }}">{{ "Social Media description"|t("seo-fields") }}
{{ forms.textArea({ @@ -53,7 +53,7 @@ {% if craft.app.volumes.getAllVolumes()|length %} {{ forms.elementSelectField({ - label: "Facebook OG image"|t('seo-fields'), + label: "Social Media image"|t('seo-fields'), id: name ~ "-facebookImage", name: name ~ "[facebookImage]", elements: value.facebookImage|length ? craft.assets.id(value.facebookImage|first).all() : null, diff --git a/src/templates/_components/fields/_tabs/_twitter.twig b/src/templates/_components/fields/_tabs/_twitter.twig deleted file mode 100644 index c836783..0000000 --- a/src/templates/_components/fields/_tabs/_twitter.twig +++ /dev/null @@ -1,75 +0,0 @@ -{% import "_includes/forms" as forms %} - - - -
- -
- {{ forms.textField({ - label: "Twitter title"|t("seo-fields"), - id: name ~ "-twitterTitle", - name: name ~ "[twitterTitle]", - value: value.twitterTitle, - }) }} - -
-
- -
-
- {{ forms.textArea({ - id: name ~ "-twitterDescription", - name: name ~ "[twitterDescription]", - value: value.twitterDescription, - maxlength: 300, - showCharsLeft: true, - warning: false, - errors: value.getErrors("twitterDescription"), - }) }} -
-
-
-
- {% if craft.app.volumes.getAllVolumes()|length %} - {{ forms.elementSelectField({ - label: "Twitter image"|t('seo-fields'), - id: name ~ "-twitterImage", - name: name ~ "[twitterImage]", - elements: value.twitterImage|length ? craft.assets.id(value.twitterImage|first).all() : null, - elementType: "craft\\elements\\Asset", - viewMode: "large", - criteria: { - kind: ["image"], - }, - limit: 1, - selectionLabel: "Select an image"|t('seo-fields'), - }) }} - {% else %} -
-

{{ "Twitter image"|t("seo-fields") }}

-

{{ "No asset volumes defined"|t("seo-fields") }}.

-
- {% endif %} -
-