Set media image url with image style token for meta image in drupal 8 & 9

Image url is a must-have for webpages to be properly shareable on social media. With this token snippet you can set a media entity url with image style token.

[node:field_image:entity:field_media_image:large:url]

This will refer to: 

  • Field image, which is a media field
  • The media entity has a field called field_media_image
  • The image style large 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!