Facebook Tools

Struggeling to get your site more social with the Facebook plugins? Stop struggeling and use the Facebook Tools module for ExpressionEngine. With this module you can add easily Facebook plugins to your site in an eyewink. It supports both HTML5 and XFBML. All Facebook Events are registerd to Google Analytics if possible; eg subscribe`s.

Supported plugins

Comments, Follow, Like Box, Like Button, Recommendations Box, Send, fb:name, fb:profile-pic

Installation

Prerequisites

Make sure your system meets the minimum requirements:

Installation Instructions**

  1. Upload ee2/system/third_party/fb_tools to system/expressionengine/third_party/
  2. Upload ee2/system/themes/third_party/fb_tools to themes/third_party/
  3. Install the module in Add-Ons → Modules

How it works

First of all you have to add the {exp:fb_tools:init} method in the <head> of the page. This method will add all necessary javascript and css to you page to get the plugin fully working. See here the tags that the init function can accept.

After weve added theinitmethod to thewe can start adding the Facebook plugins. This can be done by putting{exp:fb_tools:plugin_name}` in your page.

Also make sure you setup a facebook developer account and add your api number in the settings cp.

Init Tag

{exp:fb_tools:init
   lang="en_US"
}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

lang

the language code. e.g. en_US or nl_NL, Default to en_US

lang=""

auth_app

Must the user auth with the app?

auth_app="no"

Default Tekst to the plugin

To add some default tekst or loading icon before the app is loaded, use the default_text="". This parameter is available in every plugin

Comments

{exp:fb_tools:comments}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

width

the width of the plugin in pixels. Minimum recommended width: 400px.

width="500px"

num_posts

the number of comments to show by default. Default: 10. Minimum: 1

num_posts="10"

colorscheme

the color scheme for the button. Options: 'light', 'dark'

colorscheme="light"

order_by

The order to use when displaying comments. Can be "social", "reverse_time", or "time". The different order types are explained

order_by="social"

Follow

{exp:fb_tools:follow}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

layout

layout - there are three options.

layout=""

show_faces

specifies whether to display profile photos below the button (standard layout only)

show_faces=""

font

the font to display in the plugin. Options: 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', 'verdana'

colorscheme=""

width

the width of the plugin.

width="300"

Like Box

{exp:fb_tools:like_box}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

width

the width of the plugin.

width="300"

height

the height of the plugin in pixels. The default height varies based on number of faces to display, and whether the stream is displayed. With the stream displayed, and 10 faces the default height is 556px. With no faces, and no stream the default height is 63px.

height=""

show_faces

specifies whether to display profile photos below the button (standard layout only)

show_faces=""

stream

specifies whether to display a stream of the latest posts from the Page's wall

stream=""

specifies whether to display the Facebook header at the top of the plugin.

header=""

border_color

the border color of the plugin.

border_color=""

force_wall

for Places, specifies whether the stream contains posts from the Place's wall or just checkins from friends. Default value: false.

force_wall=""

Like Button

{exp:fb_tools:like_button}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

send

specifies whether to include a Send button with the Like button. This only works with the XFBML version.

send=""

layout

layout - there are three options. Default to standaard

layout=""

show_faces

specifies whether to display profile photos below the button (standard layout only)

show_faces=""

width

the width of the Like button.

width=""

action

the verb to display on the button. Options: 'like', 'recommend'

action=""

font

the font to display in the button. Options: 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', 'verdana'

font=""

ref

a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). The ref attribute causes two parameters to be added to the referrer URL when a user clicks a link from a stream story about a Like action:

ref=""

Send

{exp:fb_tools:send}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

font

the font to display in the button. Options: 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', 'verdana'

font=""

ref

a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). The ref attribute causes two parameters to be added to the referrer URL when a user clicks a link from a stream story about a Like action:

ref=""

Recommendation Bar

{exp:fb_tools:recommendation_bar}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Defaults to the current url.

href=""

ref

a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). The ref attribute causes two parameters to be added to the referrer URL when a user clicks a link from a stream story about a Like action:

ref=""

trigger

trigger - when the plugin expands. Note that this parameter is evaluated in addition to the read_time parameter. Default is when a user scrolls past the tag. There are three options.

trigger=""

read_time

The number of seconds before the plugin will expand. Default is 30 seconds. Minimum is 10 seconds.

read_time=""

action

The verb to display on the button. Options: 'like', 'recommend'

action=""

side

the side of the screen where the plugin will be displayed. This will automatically adjust based on the language, or can be set explicitly. Options: 'left', 'right'

side=""

site

a comma separated list of domains to show recommendations for. The default is the domain of the href parameter.

site=""

num_recommendations

the number of recommendations to display. By default, this value is 2 and the maximum value is 5.

num_recommendations=""

max_age

a limit on recommendation and creation time of articles that are surfaced in the plugins, the default is 0 (we don’t take age into account). Otherwise the valid values are 1-180, which specifies the number of days.

max_age=""

Recommendations box

{exp:fb_tools:recommendation_box}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

ref

a label for tracking referrals; must be less than 50 characters and can contain alphanumeric characters and some punctuation (currently +/=-.:_). The ref attribute causes two parameters to be added to the referrer URL when a user clicks a link from a stream story about a Like action:

ref=""

max_age

a limit on recommendation and creation time of articles that are surfaced in the plugins, the default is 0 (we don’t take age into account). Otherwise the valid values are 1-180, which specifies the number of days.

max_age=""

site

a comma separated list of domains to show recommendations for. The default is the domain of the href parameter.

site=""

action

a comma separated list of actions to show activities for.

action=""

width

the width of the plugin in pixels. Default width: 300px.

width=""

height

the height of the plugin in pixels. Default height: 300px.

height=""

specifies whether to show the Facebook header. Default to yes

header=""

font

the font to display in the plugin. Options: 'arial', 'lucida grande', 'segoe ui', 'tahoma', 'trebuchet ms', 'verdana'

font=""

border_color

the border color of the plugin.

border_color=""

linktarget

This specifies the context in which content links are opened. By default all links within the plugin will open a new window. If you want the content links to open in the same window, you can set this parameter to _top or _parent. Links to Facebook URLs will always open in a new window.

linktarget=""

Facebook Name

{exp:fb_tools:get_name}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

uid

The ID of the user or Page whose name you want to show. Alternately, you can use profileowner only on a user's profile; you can use loggedinuser only on canvas pages.

uid=""

firstnameonly

Show only the user's first name. Default value is no

firstnameonly=""

linked

Link to the user's profile. Default value is yes

linked=""

lastnameonly

Show only the user's last name. Default value is no

lastnameonly=""

capitalize

Capitalize the text if useyou is true and loggedinuser is uid. Default value is yes

capitalize=""

subjectid

The Facebook ID of the subject of the sentence where this name is the object of the verb of the sentence. Will use the reflexive when appropriate. When subjectid is used, uid is considered to be the object and uid's name is produced.

subjectid=""

possessive

Make the user's name possessive (e.g. Joe's instead of Joe). Default value is no.

possessive=""

reflexive

Use yourself if useyou is yes. Default value is no.

reflexive=""

shownetwork

Displays the primary educational network for the uid, if applicable. Other networks do not show. Default value is no.

shownetwork=""

useyou

Use you if uid matches the logged in user. Default value is yes.

useyou=""

ifcantsee

Alternate text to display if the logged in user cannot access the user specified. To specify an empty string instead of the default, use ifcantsee="". Default value is Facebook User

ifcantsee=""

Facebook Profile Pic

{exp:fb_tools:get_profile_pic}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

uid

The ID of the user or Page whose name you want to show. Alternately, you can use profileowner only on a user's profile; you can use loggedinuser only on canvas pages.

uid=""

size

The size of the image to display. Default value is thumb. Other valid values are thumb (t) (50px wide), small (s) (100px wide), normal (n) (200px wide), and square (q) (50px by 50px). Or, you can specify width and height settings instead, as described below.

size=""

linked

Make the image a link to the user's profile. Default value is yes

linked=""

(For use with Facebook Connect only.) When set to true, it returns the Facebook favicon image, which gets overlaid on top of the user's profile picture on a site.

facebook_logo=""

width

Specifies the desired width, in pixels, of the image (like an img tag).

width=""

height

Specifies the desired height, in pixels, of the image (like an img tag).

height=""

Comment count

Get the total comments

{exp:fb_tools:comment_count}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

The url

href=""

Share Button

{exp:fb_tools:share}

Tag Parameters

Below are the Tag Parameters. Those parameters can be used in the tag described above.

href

the URL for this Comments plugin. News feed stories on Facebook will link to this URL. Default to the current url.

href=""

width

The width of the plugin in pixels. Minimum recommended width: 400px. Default to 500

width=""

layout

Selects one of the different layouts that are available for the plugin. Can be one of "box_count", "button_count", "button", "link", "icon_link", or "icon". default: icon_link

layout=""

Changelog

3.0.0 (04-12-2017)

2.0.1

2.0.0

1.4.0

1.3

1.2.3

1.2.2

1.2.1

1.2

1.1.3

1.1.2

1.1.1

1.1

1.0