1

I am trying to optimise SEO on my site by ensuring that each page has a unique value for descriptive metatags.

I am trying to achieve this using the Token and Metatags modules, and am using Drupal 8.

To do this, I have added a field called "Description" to both the basic page and article content types.

I would then like to use the [node:field_description] token as the value for any relevant metatags in the Metatags module.

However, when I view available tokens in the Metatags module the [node] token is not available and the [current-page] token doesn't appear to have any way to reference the main node displayed within that page.

I know this issue has been discussed extensively for D7 and this issue appears to provide what I'm looking for:

https://www.drupal.org/project/token/issues/919760

Is there an equivalent solution for D8? Alternatively, what's the best way of achieving this?

  • I'm not at my desk anymore for today, but I'm pretty sure you have the [node] token available for content meta tags and can access field content as well. We're using these tokens regularly for all D8 sites we're working on. Where did you try to add them? – Mario Steinitz Jan 7 '18 at 14:21
  • Thanks! You're completely correct. I was trying to use node tokens for the global metatags. When I go into the content metatags specifically - yes, these now appear correctly. – James Naish Jan 7 '18 at 14:43
0

This from Mario Steinitz (in comments) answered the question:

"I'm not at my desk anymore for today, but I'm pretty sure you have the [node] token available for content meta tags and can access field content as well. We're using these tokens regularly for all D8 sites we're working on. Where did you try to add them?"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.