From 6f8544f378c966c52b1a3f7305b06b0fed151e12 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Tue, 19 Jul 2016 13:51:40 -0400 Subject: [PATCH] [Fixed] Fixed an issue with SEO images not rendering properly via the FieldType [Improved] Explicitly state that the SEO Image must be in JPG, PNG, or GIF format --- DOCS.md | 10 +++++----- README.md | 2 ++ releases.json | 2 ++ services/SeomaticService.php | 2 +- templates/creator/_edit.twig | 4 ++-- templates/field.twig | 4 ++-- templates/identity/_edit.twig | 4 ++-- templates/meta/_main.twig | 4 ++-- templates/site/_edit.twig | 4 ++-- 9 files changed, 20 insertions(+), 16 deletions(-) diff --git a/DOCS.md b/DOCS.md index 89d04b9..8c94b83 100755 --- a/DOCS.md +++ b/DOCS.md @@ -72,7 +72,7 @@ You can also dynamically change any of these SEO Meta fields in your Twig templa * **Site SEO Name Separator** - The character that should be used to separate the Site SEO Name and Title in the `` tag * **Site SEO Description** - This should be between 70 and 160 characters (spaces included). Meta descriptions allow you to influence how your web pages are described and displayed in search results. Ensure that all of your web pages have a unique meta description that is explicit and contains your most important keywords. * **Site SEO Keywords** - Google ignores this tag; though other search engines do look at it. Utilize it carefully, as improper or spammy use most likely will hurt you, or even have your site marked as spam. Avoid overstuffing the keywords and do not include keywords that are not related to the specific page you place them on. -* **Site SEO Image** - This is the image that will be used for display as the global website brand, as well as on Twitter Cards and Facebook OpenGraph that link to the website. It should be an image that displays well when cropped to a square format (for Twitter) +* **Site SEO Image** - This is the image that will be used for display as the global website brand, as well as on Twitter Cards and Facebook OpenGraph that link to the website. The image must be in JPG, PNG, or GIF format. * **SEO Image Transform** - The image transform to apply to the Site SEO Image. * **Site Twitter Card Type** - With Twitter Cards, you can attach rich photos and information to Tweets that drive traffic to your website. Users who Tweet links to your content will have a “Card” added to the Tweet that’s visible to all of their followers. * **Twitter Image Transform** - The image transform to apply to the Twitter SEO Image. Twitter recommends: 120 x 120 pixels minimum size, 1:1 aspect ratio, 1mb max size for Summary Card images, and 280x150 pixels minimum size, 1.86:1 aspect ratio, 1mb max size for Summary Card with Large Image images. @@ -144,7 +144,7 @@ There is also a `gtmDataLayerVariableName` variable in `config.php` which allows * **Alternate Entity Name** - An alternate or nickname for the entity that owns the website * **Entity Description** - A description of the entity that owns the website * **Entity URL** - A URL for the entity that owns the website -* **Entity Brand** - An image or logo that represents the entity that owns the website +* **Entity Brand** - An image or logo that represents the entity that owns the website. The image must be in JPG, PNG, or GIF format. * **Entity Telephone** - The primary contact telephone number for the entity that owns the website * **Entity Email** - The primary contact email address for the entity that owns the website @@ -227,7 +227,7 @@ Leave any fields blank that aren't applicable or which you do not want as part o * **Alternate Entity Name** - An alternate or nickname for the entity that created the website * **Entity Description** - A description of the entity that created the website * **Entity URL** - A URL for the entity that created the website -* **Entity Brand** - An image or logo that represents the entity that created the website +* **Entity Brand** - An image or logo that represents the entity that created the website. The image must be in JPG, PNG, or GIF format. * **Entity Telephone** - The primary contact telephone number for the entity that created the website * **Entity Email** - The primary contact email address for the entity that created the website @@ -282,7 +282,7 @@ You can also dynamically change any of these SEO Meta fields in your Twig templa * **SEO Title** - This should be between 10 and 70 characters (spaces included). Make sure your title tag is explicit and contains your most important keywords. Be sure that each page has a unique title tag. * **SEO Description** - This should be between 70 and 160 characters (spaces included). Meta descriptions allow you to influence how your web pages are described and displayed in search results. Ensure that all of your web pages have a unique meta description that is explicit and contains your most important keywords. * **SEO Keywords** - Google ignores this tag; though other search engines do look at it. Utilize it carefully, as improper or spammy use most likely will hurt you, or even have your site marked as spam. Avoid overstuffing the keywords and do not include keywords that are not related to the specific page you place them on. -* **SEO Image** - This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. It should be an image that displays well when cropped to a square format (for Twitter) +* **SEO Image** - This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. The image must be in JPG, PNG, or GIF format. * **SEO Image Transform** - The image transform to apply to the Site SEO Image. * **Twitter Card Type** - With Twitter Cards, you can attach rich photos and information to Tweets that drive traffic to your website. Users who Tweet links to your content will have a “Card” added to the Tweet that’s visible to all of their followers. * **Twitter Image Transform** - The image transform to apply to the Twitter SEO Image. Twitter recommends: 120 x 120 pixels minimum size, 1:1 aspect ratio, 1mb max size for Summary Card images, and 280x150 pixels minimum size, 1.86:1 aspect ratio, 1mb max size for Summary Card with Large Image images. @@ -313,7 +313,7 @@ You can also dynamically change any of these SEO Meta fields in your Twig templa * **SEO Title** - This should be between 10 and 70 characters (spaces included). Make sure your title tag is explicit and contains your most important keywords. Be sure that each page has a unique title tag. * **SEO Description** - This should be between 70 and 160 characters (spaces included). Meta descriptions allow you to influence how your web pages are described and displayed in search results. Ensure that all of your web pages have a unique meta description that is explicit and contains your most important keywords. * **SEO Keywords** - Google ignores this tag; though other search engines do look at it. Utilize it carefully, as improper or spammy use most likely will hurt you, or even have your site marked as spam. Avoid overstuffing the keywords and do not include keywords that are not related to the specific page you place them on. -* **SEO Image** - This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. It should be an image that displays well when cropped to a square format (for Twitter) +* **SEO Image** - This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. The image must be in JPG, PNG, or GIF format. * **SEO Image Transform** - The image transform to apply to the Site SEO Image. * **Twitter Card Type** - With Twitter Cards, you can attach rich photos and information to Tweets that drive traffic to your website. Users who Tweet links to your content will have a “Card” added to the Tweet that’s visible to all of their followers. * **Twitter Image Transform** - The image transform to apply to the Twitter SEO Image. Twitter recommends: 120 x 120 pixels minimum size, 1:1 aspect ratio, 1mb max size for Summary Card images, and 280x150 pixels minimum size, 1.86:1 aspect ratio, 1mb max size for Summary Card with Large Image images. diff --git a/README.md b/README.md index f89f621..f027648 100755 --- a/README.md +++ b/README.md @@ -53,7 +53,9 @@ Some things to do, and ideas for potential features: ### 1.1.25 -- 2016.07.20 +* [Fixed] Fixed an issue with SEO images not rendering properly via the FieldType * [Improved] Added a fallback if `iconv` is not installed for UTF-8 conversion +* [Improved] Explicitly state that the SEO Image must be in JPG, PNG, or GIF format * [Improved] Updated the README.md ### 1.1.24 -- 2016.07.18 diff --git a/releases.json b/releases.json index ab906e3..4a85438 100644 --- a/releases.json +++ b/releases.json @@ -4,7 +4,9 @@ "downloadUrl": "https://github.com/nystudio107/seomatic/archive/master.zip", "date": "2016-07-20T11:00:00-11:00", "notes": [ + "[Fixed] Fixed an issue with SEO images not rendering properly via the FieldType", "[Improved] Added a fallback if `iconv` is not installed for UTF-8 conversion", + "[Improved] Explicitly state that the SEO Image must be in JPG, PNG, or GIF format", "[Improved] Updated the README.md" ] }, diff --git a/services/SeomaticService.php b/services/SeomaticService.php index 1b3d050..995674c 100644 --- a/services/SeomaticService.php +++ b/services/SeomaticService.php @@ -727,7 +727,7 @@ public function setEntryMeta($entryMeta, $entryMetaUrl) $meta['seoDescription'] = $entryMeta->seoDescription; $meta['seoKeywords'] = $entryMeta->seoKeywords; if (isset($entryMeta->seoImageId[0])) - $meta['seoImageId'] = $entryMeta->seoImageId[0]; + $meta['seoImageId'] = $entryMeta->seoImageId; else $meta['seoImageId'] = null; $meta['canonicalUrl'] = $this->getFullyQualifiedUrl($entryMetaUrl); diff --git a/templates/creator/_edit.twig b/templates/creator/_edit.twig index 1511be4..e613931 100755 --- a/templates/creator/_edit.twig +++ b/templates/creator/_edit.twig @@ -143,7 +143,7 @@ <div class="field" id="genericCreatorImageId-field"> <div class="heading"> <label for="genericCreatorImageId">{{ "Entity Brand"|t}}{% if craft.isLocalized and creator.locale %}<span class="locale">{{ creator.locale }}</span>{% endif %}</label> - <div class="instructions"><p>{{ "An image or logo that represents the entity that created the website" |t |raw}}</p></div> + <div class="instructions"><p>{{ "An image or logo that represents the entity that created the website. The image must be in JPG, PNG, or GIF format." |t |raw}}</p></div> </div> <div class="input"> {% if assetsSourceExists %} @@ -153,7 +153,7 @@ name: 'genericCreatorImageId', elementType: elementType, criteria: { - 'kind': [], + 'kind': ['image'], 'localeEnabled': null, 'locale': craft.locale, }, diff --git a/templates/field.twig b/templates/field.twig index 9f156f0..bdeec61 100755 --- a/templates/field.twig +++ b/templates/field.twig @@ -194,7 +194,7 @@ <div class="field comboField-wrapper" id="{{ id }}seoImageId-field"> <div class="heading"> <label for="{{ id }}seoImageId">{{ "SEO Image"|t}}{% if locale %}<span class="locale">{{ locale }}</span>{% endif %}</label> - <div class="instructions"><p>{{ "This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. It should be an image that displays well when cropped to a square format (for Twitter)" |t |raw}}</p></div> + <div class="instructions"><p>{{ "This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. The image must be in JPG, PNG, or GIF format." |t |raw}}</p></div> </div> <div class="source-container"{% if not seoImageIdSourceChangeable %} style="display: none;"{% endif %}> <div class="source-item"> @@ -237,7 +237,7 @@ name: name ~ '[seoImageId]', elementType: elementType, criteria: { - 'kind': [], + 'kind': ['image'], 'localeEnabled': null, 'locale': craft.locale, }, diff --git a/templates/identity/_edit.twig b/templates/identity/_edit.twig index 4ef1eb4..7052ffc 100755 --- a/templates/identity/_edit.twig +++ b/templates/identity/_edit.twig @@ -320,7 +320,7 @@ <div class="field" id="genericOwnerImageId-field"> <div class="heading"> <label for="genericOwnerImageId">{{ "Entity Brand"|t}}{% if craft.isLocalized and identity.locale %}<span class="locale">{{ identity.locale }}</span>{% endif %}</label> - <div class="instructions"><p>{{ "An image or logo that represents the entity that owns the website" |t |raw}}</p></div> + <div class="instructions"><p>{{ "An image or logo that represents the entity that owns the website. The image must be in JPG, PNG, or GIF format." |t |raw}}</p></div> </div> <div class="input"> {% if assetsSourceExists %} @@ -330,7 +330,7 @@ name: 'genericOwnerImageId', elementType: elementType, criteria: { - 'kind': [], + 'kind': ['image'], 'localeEnabled': null, 'locale': craft.locale, }, diff --git a/templates/meta/_main.twig b/templates/meta/_main.twig index 7cc6d94..a1a1113 100644 --- a/templates/meta/_main.twig +++ b/templates/meta/_main.twig @@ -79,7 +79,7 @@ <div class="field" id="seoImageId-field"> <div class="heading"> <label for="seoImageId">{{ "SEO Image"|t}}{% if meta.locale %}<span class="locale">{{ meta.locale }}</span>{% endif %}</label> - <div class="instructions"><p>{{ "This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. It should be an image that displays well when cropped to a square format (for Twitter)" |t |raw}}</p></div> + <div class="instructions"><p>{{ "This is the image that will be used for display as the webpage brand for this template, as well as on Twitter Cards and Facebook OpenGraph that link to this page. The image must be in JPG, PNG, or GIF format." |t |raw}}</p></div> </div> <div class="input"> {% if assetsSourceExists %} @@ -89,7 +89,7 @@ name: 'seoImageId', elementType: elementType, criteria: { - 'kind': [], + 'kind': ['image'], 'localeEnabled': null, 'locale': craft.locale, }, diff --git a/templates/site/_edit.twig b/templates/site/_edit.twig index 1924c8a..bfc6922 100755 --- a/templates/site/_edit.twig +++ b/templates/site/_edit.twig @@ -161,7 +161,7 @@ <div class="field" id="siteSeoImageId-field"> <div class="heading"> <label for="siteSeoImageId">{{ "Site SEO Image"|t}}{% if craft.isLocalized and siteMeta.locale %}<span class="locale">{{ siteMeta.locale }}</span>{% endif %}</label> - <div class="instructions"><p>{{ "This is the image that will be used for display as the global website brand, as well as on Twitter Cards and Facebook OpenGraph that link to the website. It should be an image that displays well when cropped to a square format (for Twitter)" |t |raw}}</p></div> + <div class="instructions"><p>{{ "This is the image that will be used for display as the global website brand, as well as on Twitter Cards and Facebook OpenGraph that link to the website. The image must be in JPG, PNG, or GIF format." |t |raw}}</p></div> </div> <div class="input"> {% if assetsSourceExists %} @@ -171,7 +171,7 @@ name: 'siteSeoImageId', elementType: elementType, criteria: { - 'kind': [], + 'kind': ['image'], 'localeEnabled': null, 'locale': craft.locale, },