Do you know to manage thumbnail activity in Drupal 8 social media? It's not a big deal! You can manage Drupal 8 thumbnail publishment in Twitter Cards and Facebook Open Graph. Yes! It is possible with the usage of the module “Metatag”. A Drupal 8 post has a unique identification of machine-generated images which is different from other normal images. For Twitter and Facebook, it is recommended to add images in different sizes based upon the requirement.
You can ask what is the need for the module “Metatag”? Identify the necessity from the name dude! Meta is nothing but the process of adding description, keyword and canonical values right! The administrator is authorized by the Metatag module where they can add Dublin Core Meta values without interruption.
Step 1: To install the module “Metatag” start downloading the module “Token”. Use the path admin/modules/install to download and install.
Metatag: It helps to manage entity meta tags.
Metatag Page Manager: Page Manager Variants is supported by the metatag module “Metatag Page Manager”
Metatag: App Links: It gives full support for the metatags applinks.org
Metatag Dublin Core: From the institute of Dublin Core Metatag, it gives fifteen elements of Dublin Core Metatag.
Metatag: Facebook: This metatag helps to make full control of Facebook functionality.
Metatag: favicons: Favicons metatag is supported by this module.
Metatag: Google Custom Search Engine (CSE) – You are well known with Google Custom Search Engine metatag right! It is fully supported with this module.
Metatag: Google Plus – It gives metatag guidance for Google’s Plus
Metatag: hreflang – Simplification of basic logic in hreflang is maintained here.
Metatag: Mobile & UI Adjustments – To get a full navigation experience in a mobile browser this metatag is used.
Metatag: Open Graph – It gives guidance for metatag open graph
Metatag: Open Graph Products – To describe products in an open graph this metatag is used.
Metatag: Pinterest – It gives guidance for Pinterest metatag.
Metatag: Twitter Cards – It gives guidance for Twitter Card's metatag.
Metatag: Verification – This metatag helps to verify the website ownership.
Metatag: Views – Integration of views is aligned here.
How these metatags are managed?
Enable – It enables Metatag: Views, Metatag: Verification, Metatag: Twitter Cards, Metatag: Open Graph, Metatag: Mobile & UI adjustments, Metatag: favicons, Metatag: Facebook, Metatag: Dublin Core, Metatag: Metatag Page Manager.
Do Not Enable – If you have an idea not to enable certain modules for example Metatag: Google Plus
Enable Only if Needed: You can give enablement for few metatags such as Metatag: Pinterest, Metatag: Open Graph products, Metatag: hreflang, Metatag: Google Custom Search Engine (CSE), Metatag: Dublin Core Advanced, Metatag: App Links.
Whatever module you enable, it gives full privilege to Panels, Views and Content-Type.
Step 2: To which other modules metatag gives configuration? You can work on generating thumbnail image Twitter and Facebook keywords, description and SEO configuration. Whenever you share the post in Drupal 8 it should have an ideal image of Twitter and Facebook record.
Of course! The image should have an auto-generated description, title and keyword for user views. Use this path admin/config/search/metatag to make changes in settings of a content type.
Make sure that the metatag categories have reviews but you cannot view them on the previous page. You can view this only on the next page. Go for numerous checks in metatags!
Here comes the usage of the Token module! Or else you can try for each page to set static single logo. Once if you find the configuration page for Metatag, you can see “Browse available tokens” then do select dynamic value.
Start giving the token values for Twitter and Facebook. Check the metatag display by viewing source code, article and blog.
Step 3: With the thumbnail image creation in Drupal 8, the post can be shared on Facebook and Twitter.
Go the path admin/config/media/image-styles for creating the size of image 1200 px x 630 px
Now create 2:1 image size to 4096 px x 4096 px maximum size of image. Start saving the changes made till now and from now you is free to use token variables for display.
Do select the token “node” and choose the value for the Image Thumbnail content type. Refresh the website and check for the metatag display in the browser.
If you are using numerous content types of the image then use the token of comma-separated.
Step 4: Still Metatag module runs behind normally! You can use it for custom Image Thumbnails for reference.
For Image Size – Open Graph use:
"The URL of an image that should represent the content. The image must be at least 200 x 200 pixels in size; 600 x 316 pixels is a recommended minimum size, and for best results use an image least1200 x 630 pixels in size. Supports PNG, JPEG and GIF formats. Should not be used if og:image:urlis used. Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not specifically the first one. Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically. This will be able to extract the URL from an image field."
For Twitter Card:
"A set of meta tags specially for controlling the summaries displayed when content is shared on Twitter."
For Type of Twitter Card, you have more number of types such as
No other fields are required for a Summary card.
Photo card requires the 'image' field.
Media player card requires the 'title', 'description', 'media player URL', 'media player width', 'media player height' and 'image' fields.
Summary Card with Large Image card requires the 'Summary' field and the 'image' field.
Gallery Card requires all the 'Gallery Image' fields.
App Card requires the 'iPhone app ID' field, the 'iPad app ID' field and the 'Google Play app ID' field.
Product Card requires the 'description' field, the 'image' field, the 'Label 1' field, the 'Data 1' field, the 'Label 2' field and the 'Data 2' field.
You will get the output as:
Step 5: Set and get copy the URL to the tools of Facebook and Twitter development. Using the validate of Twitter Card, you can see the preview of page description and Image Thumbnail.
To test metatags for Facebook Open Graph, use Facebook Crawler.
That’s it! More number of metatags gives you more features! Setting up the metatag for your website improves traffic to the website and page clear explanation.
You can ask what is the need for the module “Metatag”? Identify the necessity from the name dude! Meta is nothing but the process of adding description, keyword and canonical values right! The administrator is authorized by the Metatag module where they can add Dublin Core Meta values without interruption.
Step 1: To install the module “Metatag” start downloading the module “Token”. Use the path admin/modules/install to download and install.
Metatag: It helps to manage entity meta tags.
Metatag Page Manager: Page Manager Variants is supported by the metatag module “Metatag Page Manager”
Metatag: App Links: It gives full support for the metatags applinks.org
Metatag Dublin Core: From the institute of Dublin Core Metatag, it gives fifteen elements of Dublin Core Metatag.
Metatag: Facebook: This metatag helps to make full control of Facebook functionality.
Metatag: favicons: Favicons metatag is supported by this module.
Metatag: Google Custom Search Engine (CSE) – You are well known with Google Custom Search Engine metatag right! It is fully supported with this module.
Metatag: Google Plus – It gives metatag guidance for Google’s Plus
Metatag: hreflang – Simplification of basic logic in hreflang is maintained here.
Metatag: Mobile & UI Adjustments – To get a full navigation experience in a mobile browser this metatag is used.
Metatag: Open Graph – It gives guidance for metatag open graph
Metatag: Open Graph Products – To describe products in an open graph this metatag is used.
Metatag: Pinterest – It gives guidance for Pinterest metatag.
Metatag: Twitter Cards – It gives guidance for Twitter Card's metatag.
Metatag: Verification – This metatag helps to verify the website ownership.
Metatag: Views – Integration of views is aligned here.
How these metatags are managed?
Enable – It enables Metatag: Views, Metatag: Verification, Metatag: Twitter Cards, Metatag: Open Graph, Metatag: Mobile & UI adjustments, Metatag: favicons, Metatag: Facebook, Metatag: Dublin Core, Metatag: Metatag Page Manager.
Do Not Enable – If you have an idea not to enable certain modules for example Metatag: Google Plus
Enable Only if Needed: You can give enablement for few metatags such as Metatag: Pinterest, Metatag: Open Graph products, Metatag: hreflang, Metatag: Google Custom Search Engine (CSE), Metatag: Dublin Core Advanced, Metatag: App Links.
Whatever module you enable, it gives full privilege to Panels, Views and Content-Type.
Step 2: To which other modules metatag gives configuration? You can work on generating thumbnail image Twitter and Facebook keywords, description and SEO configuration. Whenever you share the post in Drupal 8 it should have an ideal image of Twitter and Facebook record.
Of course! The image should have an auto-generated description, title and keyword for user views. Use this path admin/config/search/metatag to make changes in settings of a content type.
Make sure that the metatag categories have reviews but you cannot view them on the previous page. You can view this only on the next page. Go for numerous checks in metatags!
Here comes the usage of the Token module! Or else you can try for each page to set static single logo. Once if you find the configuration page for Metatag, you can see “Browse available tokens” then do select dynamic value.
Start giving the token values for Twitter and Facebook. Check the metatag display by viewing source code, article and blog.
Step 3: With the thumbnail image creation in Drupal 8, the post can be shared on Facebook and Twitter.
Go the path admin/config/media/image-styles for creating the size of image 1200 px x 630 px
Now create 2:1 image size to 4096 px x 4096 px maximum size of image. Start saving the changes made till now and from now you is free to use token variables for display.
Do select the token “node” and choose the value for the Image Thumbnail content type. Refresh the website and check for the metatag display in the browser.
If you are using numerous content types of the image then use the token of comma-separated.
Step 4: Still Metatag module runs behind normally! You can use it for custom Image Thumbnails for reference.
For Image Size – Open Graph use:
"The URL of an image that should represent the content. The image must be at least 200 x 200 pixels in size; 600 x 316 pixels is a recommended minimum size, and for best results use an image least1200 x 630 pixels in size. Supports PNG, JPEG and GIF formats. Should not be used if og:image:urlis used. Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not specifically the first one. Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically. This will be able to extract the URL from an image field."
For Twitter Card:
"A set of meta tags specially for controlling the summaries displayed when content is shared on Twitter."
For Type of Twitter Card, you have more number of types such as
- Product Card
- Player Card
- App Card
- Gallery Card
- Photo Card
- Summary Card with large image
- Summary Card
No other fields are required for a Summary card.
Photo card requires the 'image' field.
Media player card requires the 'title', 'description', 'media player URL', 'media player width', 'media player height' and 'image' fields.
Summary Card with Large Image card requires the 'Summary' field and the 'image' field.
Gallery Card requires all the 'Gallery Image' fields.
App Card requires the 'iPhone app ID' field, the 'iPad app ID' field and the 'Google Play app ID' field.
Product Card requires the 'description' field, the 'image' field, the 'Label 1' field, the 'Data 1' field, the 'Label 2' field and the 'Data 2' field.
You will get the output as:
Code:
<title>Page Title. (Maximum length 60-70 characters)</title>
<meta name="description" content="Page description. (No longer than 155 characters.)" />
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@user_name">
<meta name="twitter:title" content="Page Title">
<meta name="twitter:description" content="Page description (less than 200 characters).">
<meta name="twitter:creator" content="@author_handle">
<!-- Twitter summary card with large image must be at least 280x150px -->
<meta name="twitter:image:src" content="http://www.example.com/image.jpg">
<!-- Open Graph data -->
<meta property="og:title" content="Page Title" />
<meta property="og:type" content="blog" />
<meta property="og:url" content="http://www.example.com/" />
<meta property="og:image" content="http://example.com/image.jpg" />
<meta property="og:description" content="Meta Description" />
<meta property="og:site_name" content="Site Name" />
To test metatags for Facebook Open Graph, use Facebook Crawler.
That’s it! More number of metatags gives you more features! Setting up the metatag for your website improves traffic to the website and page clear explanation.