Basically, how I have one of my Drupal 7.x installations set up is that I have thumbnails for several different content types defined in a field. For example, field_image is the field for thumbnail images for articles.

Is there a way to make this module automatically assign the og:image tag to the field_image field so that the thumbnail will be automatically defined just by uploading the thumbnail itself? What's the best way to tackle this?

Comments

ambient.impact’s picture

Subscribing. This would be a great way to streamline a common task, I think.

venusrising’s picture

Agreed, using Drupal 6 but being able to define a default field (especially important for sites with User generated content) would make this module much more useful.

7wonders’s picture

subscribe. A workaround in the meantime can be done as follows:

A quick way for adding a specific opengraph image from your nodes is by adding this to the relevant node.tpl.php.

$imgpath = image_style_url('YOUR_STYLE', $YOUR_IMAGE_FIELD[0]['uri']);
$element = array(
  '#tag' => 'meta', 
  '#attributes' => array(
    'property' => 'og:image',
    'content' => $imgpath,
  ),
);
drupal_add_html_head($element, 'og_image');
designguru’s picture

Any suggestions on a drupal 6 version of #3?

q./

designguru’s picture

I just came up with a solution for my drupal 6 site which I'm pretty proud of!

Check it out: http://drupal.org/node/1283234#comment-5004860

q./

venusrising’s picture

@7wonders any idea how to get this working in 6?
@designguru Tried your solution but not sure if open graph tags from facebook social module are causing it not to show

jenlampton’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Category: support » feature

also requesting this feature for 7.x