Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I use Metatag and I enter manually the title and the description for each pages. My question : how to automaticaly fill the area "Description" and "Title" in the Open Graph section? (cause I wann't do the same job two times).
I have try with [metatag:og:description] or [metatag:description] but it seems not to work.
For the title I have try : [metatag:og:title] ou [metatag:title]
Thx for your help.
Comments
Comment #1
DamienMcKennaWhat do you want to have automatically filled into the og:title and og:description tags? By default og:title will be filled in with the same [node:title] token that's used for the page title, so the node title should automatically show up. Does it not work like this for you?
Comment #2
floown CreditAttribution: floown commentedYes, it doesn't work automatically for me.
Comment #3
DamienMcKennaAre your content types using the standard 'body' field?
Comment #4
floown CreditAttribution: floown commentedOf course.
Comment #5
DamienMcKennaDo you have images at the top of the content, before any text shows?
Comment #6
floown CreditAttribution: floown commentedSure, the logo's image. For example in this url : http://www.publicitem.pro/blog/comment-partager-maniere-sure-ses-donnees...
Comment #7
DamienMcKennaCan you please update that page to use [node:summary] as the description?
Comment #8
floown CreditAttribution: floown commentedDone.
Comment #9
DamienMcKennaCan you set the og:description tag to the same value?
Comment #10
floown CreditAttribution: floown commentedDone. It works
Comment #11
DamienMcKennaOk cool. So what you have to do is make sure that the value for those description fields in the Node configuration at admin/config/search/metatags is set to [node:summary] and it should work; that should be the default. Once that's working you only have to customize the individual nodes where you want to change the default, rather than all of them.
Comment #12
floown CreditAttribution: floown commented(I have set the blog entry with the manual description I had enter)
Comment #13
floown CreditAttribution: floown commentedIn fact, I wanted that the manualy description entered in the classical metatags provide by Metatags module is reported to the Open Graph's description.
So [metatag:description] doesn't work.
Comment #14
floown CreditAttribution: floown commentedMessage d'erreur
The Content description utilise les jetons (tokens) invalides suivants : [node:summary].
[node:summary] is not in the valids token.
Comment #15
DamienMcKennaOut of interest, are you using Context Metatag to assign the defaults?
Comment #16
floown CreditAttribution: floown commentedMetatag Context is desactivated.
Comment #17
DamienMcKennaOk, I'm confused why it would say [node:summary] isn't working. Can you try using [node:metatag:description] to for og:description to see if that pulls in the main description?
Comment #18
floown CreditAttribution: floown commentedMessage d'erreur
The Content description utilise les jetons (tokens) invalides suivants : [node:metatag:description].
Comment #19
DamienMcKennaWhat's the exact URL of the page where you are filling in those tokens, without the hostname?
Comment #20
floown CreditAttribution: floown commentedOk, [current-page:title] works, but not in the frontpage. If I should manually edit the title for this only frontpage, the job is not tiresome.
For your question, I have try the token you said in : admin/config/search/metatags/config/global
Comment #21
DamienMcKennaAh! That explains it! In order to customize the meta tags for all nodes you should be customizing the "node" configuration at admin/config/search/metatags/config/node, not the "global" configuration at admin/config/search/metatags/config/global.
I recently posted a video explaining how to use it all, it might help:
https://www.mediacurrent.com/blog/video-metatag-15
Comment #22
floown CreditAttribution: floown commentedThx a lot, it work like you said. A big thank for all your work for Drupal!
Have a nice day (or night ?).
Comment #23
DamienMcKennaYou're very welcome, I'm glad we were able to work out what the problem was :)