markzzz
markzzz

Reputation: 47995

Facebook plugins I like - where does it take infos about title/description/photo?

When I do an "I Like" on a website with the facebook plugins, I see on Facebook there is the Title of that page, a description, an image, and so on...

If I try to put the plugins on my website and do an "I Like", I can only see title on of the main page, nothing more!

On which tag need I to insert the image path, description, and a custom title? Actually, my doctype is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

so, not an HTML5 page.

Upvotes: 1

Views: 227

Answers (1)

Lix
Lix

Reputation: 47996

You should readup on the Open Graph Protocol.
Essentially you'll need to embed some og:tags onto your page so that Facebook can know what information to display for the preview of the like action.

The tags should be placed within your head tag and they look something like this :

<meta property="fb:app_id" content="YOUR_APP_ID" /> 
<meta property="og:type" content="YOUR_NAMESPACE:recipe" /> 
<meta property="og:title" content="YOUR_PAGE_TITLE" /> 
<meta property="og:image" content="YOUR_IMAGE_URL" /> 
<meta property="og:description" content="YOUR_DESCRIPTION_TEXT" /> 
<meta property="og:url" content="YOUR_URL"> 

Don't forget to substitute the values there for your own values. If you are having difficulties in choosing what tags to use or what values to use - you should check out this great tool that Facebook has provided us :
Facebook's URL Debugger

This tool will show you exactly how Facebook views your URL and it will also alert you to any errors that you might have with your og:tags.


Be aware of the caching that Facebook does of your tags :
Taken from the Open Graph Documentation

Editing Meta Tags

You can update the attributes of your page by updating your page's tags. Note that og:title and og:type are only editable initially - after your page receives 50 likes the title becomes fixed, and after your page receives 10,000 likes the type becomes fixed. These properties are fixed to avoid surprising users who have liked the page already. Changing the title or type tags after these limits are reached does nothing, your page retains the original title and type.

For the changes to be reflected on Facebook, you must force your page to be scraped. The page is scraped when an admin for the page clicks the Like button or when the URL is entered into the Facebook URL Linter.

Upvotes: 2

Related Questions