Extension:TwitterFBLike

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
TwitterFBLike

Release status: beta

Implementation Parser extension
Description Parser that inserts Twitter and Facebook "Like" buttons on a page
Author(s) Barry Coughlan
MediaWiki Tested on 1.17
License GPL 2.0 or higher
Download Here (github)
Hooks used
ParserFirstCallInit

LanguageGetMagic
BeforePageDisplay

Check usage and version matrix

Parser that inserts Twitter and Facebook "Like" buttons on a page.


Contents

Usage [edit]

Insert the TwitterFBLike parser tag into your wiki page. The tag takes three parameters:

  1. Float: Floats the div that contains the icons. Valid values are "left" or "right", empty value means don't float.
  2. Small mode: Uses the small version of the icons if set to "small". Uses the big versions otherwise
  3. Like/Recommend If set to "like", uses the word "Like" instead of "Recommend" on the Facebook button.

Examples:

{{#TwitterFBLike:|small}}

TwitterFBLike0.png


{{#TwitterFBLike:|small|like}}

TwitterFBLike1.png


{{#TwitterFBLike:||}}

TwitterFBLike2.png


{{#TwitterFBLike:||like}}

TwitterFBLike3.png


You can also float the image left or right:

{{#TwitterFBLike:left|small}}
{{#TwitterFBLike:right|small}}

Installation [edit]

Download the package from the Github link in the sidebar (click the big "Downloads" button and get the latest zip file). Unzip the TwitterFBLike folder into /extensions/ inside your Mediawiki installation, (so that the path to TwitterFBLike.php is /extensions/TwitterFBLike/TwitterFBLike.php).

In your LocalSettings.php, add the following line to the bottom of the file:

require_once("$IP/extensions/TwitterFBLike/TwitterFBLike.php");

Customising the CSS [edit]

TwitterFBLike.css lets you customise the CSS for all buttons, and on a per-page basis. Note that the Twitter and Facebook buttons themselves can't be customised because they are in <iframe> tags.

To customise all pages, edit:

/* CSS for small version */
.twitterFBLike_small {
   ...
}

/* CSS for big version */
.twitterFBLike_small {
   ...
}

To customise a single page, add an entry with the URL page title appended to the class:

.twitterFBLike_Main_Page {
   ...
}

Reporting bugs [edit]

Please use the GitHub issue tracker to report any bugs or other issues.