Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Facebook Connect instructions don't make sense at all!

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 597 Views
  • grez868
    Avatar
    Community Member
    3 Posts

    Facebook Connect instructions don't make sense at all! Link to this post

    I am trying to install Facebook Connect to my SilverStripe sites and the information provided by Willrossi on github is a load of rubbish. When he says to put something somewhere he never specified actually WHERE.

    such as:

    You need to add the fb: namespace to your Page.ss file. For example your tag at the top should look like

    <html lang="en" xmlns:fb="http://www.facebook.com/2008/fbml">

    ^ he doesn't even say which of the three page.ss files to use or all.

    ----

    If you haven't disabled the FacebookConnect::$create_member variable you can access the Facebook's member information by using:

    <% control CurrentMember %>
    $FirstName $LastName $Avatar(small)
    <% end_control %>

    ^ In the above he doesn't say where this variable even is...for someone who doesn't know SilverStripe that much yet this is just sub-standard guidance.

    ----

    and also

    Once you have done that you should be able to use the includes provided in this module.

    <% if CurrentFacebookMember %>
    <p>Hi $CurrentFacebookMember.FirstName</p>
    <% include ConnectLogout %>
    <% else %>
    <% include ConnectLogin %>
    <% end_if %>
    You can also access the Facebook member information in your PHP code. The Facebook API connection and current member are cached on the controller object. So for example if this is in your Page_Controller class

    // returns the current facebook member (wrapped in a SS Member Object)
    $this->getCurrentFacebookMember();

    // returns the API connection which you can use to write your own query
    $this->getFacebook();

    ^ Once again, above he doesnt mention anything about where all this would go!

    Is anyone able to write a proper guide which explains things properly?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: Facebook Connect instructions don't make sense at all! Link to this post

    Hello,

    Is anyone able to write a proper guide which explains things properly?

    Yes, certainly, but the risk of it being considered “a load of rubbish” by someone that has not taken the time to understand the basics of SilverStripe kind of disheartens me!

    Good luck in getting help,
    Juan

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Facebook Connect instructions don't make sense at all! Link to this post

    Sorry I can't explain everything in minuscule detail. Let me try clear it up

    ^ he doesn't even say which of the three page.ss files to use or all.

    I recommend reading the tutorial on making themes with SS. That explains the concept of the 'Page.ss' files and you should find that only 1 includes a <html> tag! but to avoid any more confusion you want the themes/yourtheme/templates/Page.ss file, replacing of course yourtheme with the name of the theme you're using. You should see a existing <html> tag in there which you will need to replace. In blackcandy it's line 2 (https://github.com/silverstripe-themes/silverstripe-blackcandy/blob/master/blackcandy/templates/Page.ss#L2)

    ^ In the above he doesn't say where this variable even is...for someone who doesn't know SilverStripe that much yet this is just sub-standard guidance.

    Ah I just said what the variable is FacebookConnect::$create_member is the $create_member variable on the FacebookConnect class. Just like configuring any other variables in SS you can just put that line in your mysite/_config.php to configure eg

    FacebookConnect::$create_member = true; // OR
    FacebookConnect::$create_member = false;

    ^ Once again, above he doesnt mention anything about where all this would go!

    It can go where ever you want it to go! I don't know what your HTML looks like or if your website is designed any way but it needs to go in one of your template files (i.e Page.ss if thats where you want it!). Most devs do custom themes with their own designed templates so they need to decide where they wish to place the facebook login information.

    If you're new to SS, be aware that it's not an 'out of the box' system as Wordpress etc so while the docs are poor, it's also the design of the framework to leave specific configuration and implementation to developers and the modules don't prescribe any set rules you may be used to other frameworks.

    Get in touch if you have any other questions on the module!

  • grez868
    Avatar
    Community Member
    3 Posts

    Re: Facebook Connect instructions don't make sense at all! Link to this post

    Aah okay thanks for helping me clear it up Will

    And juanitau - i was merely saying that the instructions on GitHub weren't as full of information as they need to be for people new to the cms system who don't know php that well and don't want to spend months reading each line of code. Your comment was quite unhelpful for anyone who doesn't already have an extensive knowledge and what you posted only damages the good design and reputation of a brilliant script. If you wanted to avoid the disheartening risk then all you had to do was say where things could go like will did above.

    597 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.