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

DamienMcKenna’s picture

What 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?

floown’s picture

Yes, it doesn't work automatically for me.

DamienMcKenna’s picture

Are your content types using the standard 'body' field?

floown’s picture

Of course.

DamienMcKenna’s picture

Do you have images at the top of the content, before any text shows?

floown’s picture

Sure, the logo's image. For example in this url : http://www.publicitem.pro/blog/comment-partager-maniere-sure-ses-donnees...

DamienMcKenna’s picture

Can you please update that page to use [node:summary] as the description?

floown’s picture

Done.

DamienMcKenna’s picture

Can you set the og:description tag to the same value?

floown’s picture

Done. It works

DamienMcKenna’s picture

Ok 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.

floown’s picture

(I have set the blog entry with the manual description I had enter)

floown’s picture

In 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.

floown’s picture

Message d'erreur
The Content description utilise les jetons (tokens) invalides suivants : [node:summary].

[node:summary] is not in the valids token.

DamienMcKenna’s picture

Out of interest, are you using Context Metatag to assign the defaults?

floown’s picture

Metatag Context is desactivated.

DamienMcKenna’s picture

Ok, 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?

floown’s picture

Message d'erreur
The Content description utilise les jetons (tokens) invalides suivants : [node:metatag:description].

DamienMcKenna’s picture

What's the exact URL of the page where you are filling in those tokens, without the hostname?

floown’s picture

Ok, [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

DamienMcKenna’s picture

Status: Active » Fixed

Ah! 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

floown’s picture

Thx a lot, it work like you said. A big thank for all your work for Drupal!

Have a nice day (or night ?).

DamienMcKenna’s picture

You're very welcome, I'm glad we were able to work out what the problem was :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.