In the Metatag module, it states the following below the Image field in Open Graph:
Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically. This will be able to extract the URL from an image field.
Maybe I'm missing something, but this is not how it seems to work. Getting lots of error messages on node pages regarding broken URLs, and when looking at the source HTML, I see the following:
<link rel="image_src" href="http://test-site.com/Array" />
<meta property="og:image" content="http://test-site.com/Array" />
<meta property="og:image:secure_url" content="https://test-site.com/Array" />
The settings in Metatag seem fairly straightforward -- this is what exists for Open Graph Image field:
[node:field_header_image:640x360],[node:field_image:640x360]
Any suggestions?
Comments
Comment #2
sgdev commentedHave been investigating this a bit further, and it seems to me there is a fundamental flaw with this module. It suggests there is support for File Entity fields, but it really doesn't work.
Every token for an image that is a file entity runs through the
_file_entity_tokens_get_property()function. This function splits the token, and expects the second part between colons to be the$propertyvalue.Image style is not a supported property value -- the values are defined in
file_entity_token_info(). The available options are as follows:* field
* url
* filename
* filemime
* type
* image
* height
* width
* https-url
* https-image
So a token with
[node:field_header_image:640x360], andfield_header_imageas a file field is going to fail. An image style of640x360is never a valid property for_file_entity_tokens_get_property().Researching this a bit further, I'm not sure how the current approach would ever work for file entities. There either needs to be a patch to File Entity such that the
file_entity_tokensfunction is bypassed, or there needs to be a completely different token format for this module. If not, conflicts will occur.Maybe something like
[imagecache:node:field_header_image:640x360]as an alternative.Comment #3
sgdev commentedComment #4
das-peter commentedI think this is actually more an issue of the file_entity module. It returns NULL for a token it doesn't know - breaking all subsequent handling.
This issue is addressed here: #2947445: Undefined index: {file_style} in _file_entity_tokens_get_property()
I'm closing this because I think the module actually does what it is supposed to do :)
edit: Proper linking to related ticket.
Comment #5
damienmckennaThanks for finding that, das-peter!