Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » facebook login button not showing up

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3950 Views
  • PurpleSnowcone
    Avatar
    Community Member
    3 Posts

    facebook login button not showing up Link to this post

    Hello!

    I'm fairly new to SilverStripe and have been learning the ropes for the past couple days. I am trying to port my existing site into my new SilverStripe site and am running into some annoying problems.

    The old site was built around php facebook-connect and now in the new site I'm trying to simply get this FB login button to display on my index page:

    <fb:login-button size="medium" background="light" length="long" onlogin="facebook_onlogin_ready();"></fb:login-button>

    But nothing shows up! In my IndexPage page_controller init() method i have:

    Requirements::javascript('http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php');
    Requirements::customScript('FB.init("8763d5741c331101769c1e5129066211", "xd_receiver.php");');

    and in my IndexPage.ss I have changed the top to:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

    Which *I think* is all I need to do according to this document:

    http://wiki.developers.facebook.com/index.php/Facebook_Connect_Tutorial1

    Any insight as to why this login button is not appearing is greatly appreciated!

    -Joe

  • carlos
    Avatar
    Community Member
    41 Posts

    Re: facebook login button not showing up Link to this post

    hi,

    try this

    Requirements::customScript(<<<JS
    FB.init("8763d5741c331101769c1e5129066211", "xd_receiver.php");
    JS);

    instead

    Requirements::customScript('FB.init("8763d5741c331101769c1e5129066211", "xd_receiver.php");');

    good luck
    cheers

  • PurpleSnowcone
    Avatar
    Community Member
    3 Posts

    Re: facebook login button not showing up Link to this post

    Thank you for your reply, I ended up getting this to work and I wish I could explain how.

    I think I might have just had some weird/bogus HTML in my .ss so it was messing it up some how.

    Anyway, it works now.

    3950 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.