0

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 3

3

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.

4
  • Ace. Glad to have helped. Would you mind marking this as the answer? Cheers.
    – danbohea
    Feb 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.
    – jan
    Dec 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.
    – jan
    Jan 19, 2015 at 19:02
  • I'd also like to know how you made it work, since this solution did not work for me.
    – alouette
    Feb 3, 2015 at 11:39
0

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" />
0

Implement

hook_html_head_alter()

On the pages you like, alter the output of those pages like

http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_html_head_alter/7#comment-27259

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.