For the facebook comments/share/etc I get the wrong thumbnail and as far as I've googled, it's due to the og:image meta tag. I'm using Drupal for Facebook module, is there a way to alter it? I found that I have to place 'rel="image_src"' somewhere, but where? At the image tag? And how can I do that using views?
3 Answers
The Metatags module supports OpenGraph meta data with token support, patterns, overrides for individual nodes and so on. It's a really handy module for this kind of stuff.
http://drupal.org/project/metatag
If you're getting the wrong image show up in Facebook you could point it to the correct image using this module's token support.
-
Ace. Glad to have helped. Would you mind marking this as the answer? Cheers.– danboheaFeb 6, 2013 at 23:06
-
@danbohea i added the token [metatag:image_src] but I don't know where this value is coming from? I did not specify this kind of value anywhere else. Please advise.– janDec 10, 2014 at 20:37
-
@Xeen may you please advise on how you made it work? Because I just can't make it to work, Mine is using views and the metatag for views, under advanced section was (image section) [metatag:image_src] which does not work.– janJan 19, 2015 at 19:02
-
I'd also like to know how you made it work, since this solution did not work for me.– alouetteFeb 3, 2015 at 11:39
Put this in your HTML page, inside the <head>
tag; this will tell Facebook to use this image when any page from your site is posted on Facebook.
<link rel="image_src" href="http://www.example.com/facebook-logo.jpg" />
Implement
hook_html_head_alter()
On the pages you like, alter the output of those pages like
There you can
dpm($head_elements)
and unset the previous og:image, or if you are in a node page you can load this node and display a field-image ...
This becomes handy when you are not on a node page, e.g. a Views page