2

On facebook, google plus and similar websites, when someone posts a link, the thumbnail and short description of the page is automatically generated. See the screenshot below.

Is it possible to this in Drupal 7 ? If yes, how? Is there any module for it?

enter image description here

2
  • Is node teaser what you need? May 10, 2012 at 10:44
  • @ninjascorner: No. When someone pastes url of any website, the thumbnail and description should come automatically,
    – iamnik
    May 10, 2012 at 15:03

2 Answers 2

1

Look at the source for that page, you'll see this

<meta name='description' content='In honor of Wolfenstein 3D&#039;s 20th anniversary, the game will be released for free to play in browser today.'/>

Should be fairly straightforward to grab that!

2
  • Straightforward?Exactly how?
    – iamnik
    May 10, 2012 at 16:07
  • 1
    Sorry for late reply, but you can grab some meta tags with get_meta_tags php.net/manual/en/function.get-meta-tags.php - or to grab opengraph data (which if available is ideal for this kind of preview but won't be included in get_meta_tags because the tags don't have a name attribute) I've found this library to be very helpful github.com/scottmac/opengraph Jun 22, 2012 at 11:14
0

It all depends on the meta tags you have set. The easiest way to accomplish this is by installing the Meta tags module.

Once enabled, you can navigate to the configuration page and set configuration for auto-generated tags. If you need to have specific tags for a node, you can edit that node and set the meta tags there.

You should enable the Open Graph meta tags submodule, as Facebook looks for those tags when you want to share on Facebook. Whenever you update the Open Graph tags, run it through the Facebook debugger so you can see what Facebook will grab. Most of the time, Facebook should grab whatever images are available on the page and use those as thumbnails.

I use a combination of Tweet Button, Facebook Share and Google Plus One but i'm sure there are "all-in-one" shares that you can use. The most important thing remember is that if the meta tags aren't correct in the HTML, then they probably won't work correctly when you try to share your page.

1
  • I think the OP was after the other side of this - grabbing previews from external sites, not creating his own meta tags. Jun 22, 2012 at 11:15

Your Answer

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

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