Facebook like button

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Facebook like button

Postby jadwigo » Fri Aug 13, 2010 3:13 pm

This is the feedback topic for the facebook like button extension

Visit http://extensions.pivotx.net/entry/26/facebooklike for more info or download.
My pivotx playground is at http://jivotx.twokings.eu - the rest is at http://www.jadwigo.nl
jadwigo
Developer
 
Posts: 117
Joined: Wed Nov 18, 2009 9:49 am
Location: Den Haag, Netherlands

Re: Facebook like button

Postby PvC » Sun Aug 22, 2010 3:36 pm

[[like]] ;-)
PvC
 
Posts: 74
Joined: Wed Aug 19, 2009 12:07 pm

Re: Facebook like button

Postby PvC » Wed Aug 25, 2010 6:11 pm

Ik heb ALLOWTRANSPARANCY toegevoegd aan de iFrame. Daardoor is deze ook in IE transparant (en dus geen lelijk wit vlak als je een andere achtergrondkleur hebt). Of zijn hiervoor betere oplossingen?

sorry, shouldn't have used dutch:
I've added ALLOWTRANSPARANCY to the iFrame, this makes the iFrame transparent in IE so it automatically takes the colour of the page it is placed on. Is this a good idea or shouldn't I use ALLOWTRANSPARANCY?
PvC
 
Posts: 74
Joined: Wed Aug 19, 2009 12:07 pm

Re: Facebook like button

Postby AnnaDenise » Thu Aug 26, 2010 10:55 pm

Eeehhmmm...

A very dumb question, perhaps, but how do I implement this? I dragged the files to my extension folder on the server, ticked the extension box in pivotx...
... what tag do I use? And if I put it in the metadata span of my entry, will that work?

Sorry if this question is completely lame, just couldn't find this info anywhere :-) Thanks guys!
AnnaDenise
 
Posts: 14
Joined: Wed Jul 29, 2009 12:03 pm

Re: Facebook like button

Postby PvC » Fri Aug 27, 2010 5:37 am

the Tag is [[facebook_like]], but you can best read the instructions by clicking the Full Instructions link (on the extensions page, right where you 'tick' the extension)
PvC
 
Posts: 74
Joined: Wed Aug 19, 2009 12:07 pm

Re: Facebook like button

Postby Bob » Mon Aug 30, 2010 8:02 am

I've added ALLOWTRANSPARANCY to the iFrame, this makes the iFrame transparent in IE so it automatically takes the colour of the page it is placed on. Is this a good idea or shouldn't I use ALLOWTRANSPARANCY?


I think allowtransparency would work just fine, as long as you know what you're doing. When i made the extension, i just implemented it the way it was on the facebook documentation page.

Perhaps i should add an extra, optional flag for it? :-)
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Facebook like button

Postby Logfather » Mon Nov 22, 2010 10:22 am

I'm wondering if anyone is actively using the Facebook Like plugin for PivotX together with some Open Graph meta tags? Wondering how you tell the people at FB to fetch the image at the top of a post... ;)
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Facebook like button

Postby Bob » Tue Nov 23, 2010 9:03 pm

You can NOT force facebook to use an image you want, but you can suggest a title, description and image.

Add this somewhere in the <head> section of your templates. Like in the _sub_header.tpl:

Code: Select all
[[ if $modifier.pagetype=="entry"]]
   <meta property="og:title" content="[[title|escape]]" />
   <meta property="og:description" content="[[introduction|strip_tags|escape]]" />
   <meta property="og:image" content="http://example.org/pivotx/includes/timthumb.php?src=[[$entry.extrafields.image]]&w=130&h=110" />
[[/if]]


Do not change the dimensions of the thumbnail in og:image. 130x110 is the preferred size for facebook, ao it's most likely to get picked.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Facebook like button

Postby Logfather » Sat Nov 27, 2010 1:03 pm

To give some info back: Bob's code works PERFECTLY. I am just not using the Extrafields extension (should I? Maybe I'll try it out :)) so I left the image bit out for now (it's mandatory by Facebook standard, but the rest of your code still works if you leave it out).

The amazing bit? It's one thing to get things like this (the button) to work on an entry page but this code ALSO works on the frontpage or archivepage. Using Bob's code Facebook recognizes the correct title, link, image and site title (or whatever og:'s you added). I added fb_admin but I haven't yet figured out what's the deal with this code. Be sure to check out the Open Graph protocol page for more info.

TIP #1: It's annoying to check if your code is working by liking your own stuff and then checking your Facebook page. Instead use the Facebook Linter page.

TIP #2: It might be all the code in between my <head></head> but Facebook didn't read my og:code at first and than goes on scraping random stuff. Moving the code around helped me out but this is obviously not the correct way to work (because I think some other code is broken) so I will have to go back and look through all my code.
Logfather
 
Posts: 163
Joined: Sun Jul 12, 2009 9:29 am
Location: Amsterdam

Re: Facebook like button

Postby Winjer » Wed Dec 01, 2010 9:15 am

Now this is probably PivotX 101, so excuse the stupid question, but: How can I prevent the wrap after the like button?

I'd like to insert the button just before the star rating tag, but I want both the like button and the star rating to show in the same line. Is that possible?

Thank you!
Winjer
 
Posts: 36
Joined: Sat Feb 06, 2010 1:59 pm

Next

Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 4 guests

cron