og:image is not set if we use Media Field instead of File Field. Accordding to devel token tab, the token is correctly filled but not metatags.

I'm using Media-7.x-1.x branch

Comments

Version:» 7.x-1.x-dev

Same issue here

I spent a long time on this and I have figured out how to get it to work without need for a patch. What is happening is the token is getting replaced with whatever file view mode is set in your default content type display {admin/structure/types/manage/{content-type}/display/default}. This is most likely the file display, and when the tag is inserted into the head of the HTML document, the HTML tags are stripped out (<img>).

The solution is to enable the custom display for view mode "Tokens." After that you can create a file view mode for the url or link to the media image and set that as the file view mode in the display view mode format settings.

I'm not sure if the default behavior before all this set up is not a bug as it seems that image field works out of the box with this. I will try to look into this next.

Ok, it looks to me like the is a media module issue. Not so much an issue, but a feature request for default token support. The token module provides a default_token_formatter for core fields, which is necessary for token support. As the media field is deprecated I doubt there will be support for this in the future.

Although it looks like this issue may be dead in the water, this was a great opportunity for me to dive deep into the field and token apis.

Status:Active» Closed (works as designed)

Did you manage to find a solution?

I got this working with a token like [node:field-ss-portfolio-teaser-image:file:url]