Hello, i have a content with no image fields, but i embed images and other media in the body field using a WYSIWYG editor.
Is there a way to set one of the images (for example the first one) embedded in the body as the og:image?
There is not a such token in the list.

Thanks.

Comments

DamienMcKenna’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Component: Miscellaneous » User interface

There aren't tokens for this because it's such a awkward thing to do. You'd have to search through the text fields in the entity (node, user, term, etc) looking for image tags, custom embed codes for different modules (Media, entity embed, etc).. it might be better to build a widget that could grab the URL of any photo elsewhere on the page.

DamienMcKenna’s picture

Category: Support request » Feature request
haunted’s picture

Ok, I got it, thanks for your attention.

robertom’s picture

Hi, sorry for my bad english.

I need this feature and I created a sandbox for this (Token inline images).

The module is not properly tested, but it seems to do what I need

I'm a newbie with token and entity code... so very willingly accept bug reports and suggestions.

haunted’s picture

Great! I'll test it as soon as possible. Thank you very much.

EurekaWeb’s picture

@DamienMcKenna
per discussion in Add token to scrape the node body field for an image https://www.drupal.org/project/metatag/issues/2763745
has there been any further testing on the sandbox written by @robertom?

Thanks