Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook like button "breaks" when logged in as page

Tags:

facebook

I have a facebook 'Like' button on my page and it's working fine. But when the visitor is logged in as a 'Page' at facebook it includes a photo and breaks my design. I guess this is because Pages aren't allowed to like things.

I pretty much have an iframe like this: http://developers.facebook.com/docs/reference/plugins/like-box/

Any ideas of how I get rid of this image? Any way to alter the design, disable this "feature" or check if the user is logged in as a page (to hide the whole thing)?

Thanks

Edit: Screenshot of the issue: i.imgur.com/gLa7Q.png In the top one I'm logged in as a regular user and the bottom I'm "Using facebook as Page"

The code I'm using: <iframe class="facebook" src="http://www.facebook.com/plugins/like.php?href=<?=urlencode('http://www.mysite.com')?>&amp;layout=standard&amp;show_faces=false&amp;width=210&amp;action=like&amp;colorscheme=light&amp;height=45" scrolling="no" frameborder="0" allowTransparency="true"></iframe>

like image 612
AndSoYouCode Avatar asked Jul 01 '11 09:07

AndSoYouCode


2 Answers

You can use the 'overflow' element in your css to stop it breaking the design. This at least keeps the like box the same size whatever somebody is logged in to Facebook as.

1) Wrap your like box in a div and give it an id (in the HTML)

<div id="mylikebox"> Facebook like Box Code in here </div> 

2) Add to CSS (adjust height and width if you need to)

#mylikebox {
height: 70px;
width: 210px;

overflow: hidden;
}

Let Me Know if it works out!

like image 179
Nathaniel James Smithies Avatar answered Sep 25 '22 16:09

Nathaniel James Smithies


I just noticed the exact same issue. Seems a bug on FB's part, as they provide an insertion code for their like button that breaks under a particular but perfectly normal condition (i.e. signed in to FB as a page.) I would love a solution too. In the meantime the bug has prompted me to remove the FB like button altogether from my blog, which unfortunately seems to be the only solution at the moment.

like image 40
Hagbard Celine Avatar answered Sep 25 '22 16:09

Hagbard Celine