Facebook Connect 4.x

Legacy documentation for Facebook Connect 4.x.

FBC:Login_Status template tag

This is a simple tag that allows you to use conditionals to determine whether or not a user is Facebook logged in, EE logged in or both. This tag is also handy for troubleshooting on your site.

NOTE: Due to some security settings and limitations by Facebook, conditionals that check to see if the user is logged into Facebook will not work until the user has made some kind of interaction (to generate a valid security token to Facebook) with the Facebook Connect add-on on your site.

{exp:fbc:login_status} content {/exp:fbc:login_status}

Conditionals

The following conditionals are available for use:

fbc_logged_into_ee

{if fbc_logged_into_ee == "y"}{/if} 

This conditonal checks to see if the user is logged into EE. Similar to the native EE conditional.

fbc_logged_into_facebook

{if fbc_logged_into_facebook == "y"}{/if}

This conditonal checks to see if the user is logged into Facebook.

NOTE: Due to some security settings and limitations by Facebook, conditionals that check to see if the user is logged into Facebook will not work until the user has made some kind of interaction (to generate a valid security token to Facebook) with the Facebook Connect add-on on your site.

fbc_logged_into_facebook_and_ee

{if fbc_logged_into_facebook_and_ee == "y"}{/if}

This conditonal checks to see if the user is logged into Facebook AND logged into EE, AND the two accounts are synced to each other.

Examples

Below is an example of how to show/hide content based on whether or not the user is currently Facebook (synced) logged into your site:

{exp:fbc:login_status}
    {if fbc_logged_into_facebook_and_ee == "y"}

        <!-- Show Facebook logged in related controls/info here -->

    {if:else}
        <p>You have not synced your EE and Facebook accounts yet.</p>
    {/if}
{/exp:fbc:login_status}

Below is what some troubleshooting code might look like for your site.

NOTE: Due to some security settings and limitations by Facebook, conditionals that check to see if the user is logged into Facebook will not work until the user has made some kind of interaction (to generate a valid security token to Facebook) with the Facebook Connect add-on on your site.

<h3>Facebook / ExpressionEngine Login Status</h3>
<ul>
{exp:fbc:login_status}
    <li>
        Logged into ExpressionEngine?
        {if fbc_logged_into_ee == "y"}Yes{if:else}No{/if}
    </li>
    <li>
        Logged into Facebook?
        {if fbc_logged_into_facebook == "y"}Yes{if:else}No{/if}
    </li>
    <li>
        Logged into Facebook and ExpressionEngine?
        {if fbc_logged_into_ee == "y" AND fbc_logged_into_facebook == "y"}Yes{if:else}No{/if}
    </li>
    <li>
        Facebook and ExpressionEngine accounts synced?
        {if fbc_logged_into_facebook_and_ee == "y"}Yes{if:else}No{/if}
    </li>
{/exp:fbc:login_status}
</ul>