Please see it for yourself in www.durreslajm.com

Open any article and share it to facebook. When sharing 90% of the time, the sharer doesnt select the main article image. Any ideas?

Comments

massiws’s picture

I have the same problem with sharethis 6.x-1.8; post images are CCK fields.
You can have a look here:

Sometime, it seems the right image can be selected only if it's png type.
Is there a way to pass the right image field to sharethis module?

Thank you.

olak’s picture

same issue here. in a case scenario, with a news item in full node view, where is a view in the sidebar bringing 3 similar news items, the share widget gets all 4 images, and not that of the current node. also it gets them in a very strange order, not alphabetical or pub date.
thw widget works good on nodes that dont have a similar nodes on a sidebar view.

tparc’s picture

It would be nice to be able to tell module where to pull the image from, such as a specific block or region.

tparc’s picture

Vincent Rommelaars’s picture

Issue summary: View changes

Hi there,

I ran into this issue again, and the link tparc posted is a bit outdated.
I guess Facebook has an updated API.
So for anyone who has the same issue, just add attached code to your template.php file
It adds image width and height values to create preview while sharing.
Maybe better would be to implement this in ShareThis module code...

function yourtheme_preprocess_page(&$vars) {
global $base_url;
  $img = $base_url.base_path().path_to_theme()."/logo.png";
  if($vars['is_front'] != TRUE){
    if(isset($vars['node']->field_image['und'][0]['uri'])){
      $img = file_create_url($vars['node']->field_image['und'][0]['uri']);
$img_width = $vars['node']->field_image['und'][0]['width'];
$img_height = $vars['node']->field_image['und'][0]['height'];
    }
  }
  $element = array(
    '#tag' => 'meta',
    '#attributes' => array(
      "property" => "og:image",
      "content" => $img,
    ),
  );
  drupal_add_html_head($element,'facebook_share_image');
$element = array(
    '#tag' => 'meta',
    '#attributes' => array(
      "property" => "og:image:width",
      "content" => $img_width,
    ),
  );
  drupal_add_html_head($element,'og_image_width');
$element = array(
    '#tag' => 'meta',
    '#attributes' => array(
      "property" => "og:image:height",
      "content" => $img_height,
    ),
  );
  drupal_add_html_head($element,'og_image_height');
}
saeed adabi’s picture

you must install Metatag:OpenGraph module and fill image input in edit node page(tab Meta tags)
=>
https://support.sharethis.com/hc/en-us/articles/218441477-How-to-Customi...

naveenvalecha’s picture

Category: Bug report » Support request
Status: Active » Closed (works as designed)

Facebook pick the image from metatag og:image if that meta tag is not specificed then it picks random from the page.

As per #6 see how to configure metatags

Aamenis’s picture

Version: 7.x-2.4 » 7.x-2.x-dev

in after install Metatag module, Install Metatag: Facebook to preview facebook share image on facebook.