MediaWiki Extending

Overview
Media wiki can be extended in several ways


 * 1) Client-Side JavaScript
 * 2) Templates
 * 3) Extensions
 * 4) Widgets
 * 5) Miscellaneous Tools

The MediaWiki codebase contains various "hooks" using callback functions to add additional code in an extensible way. This allows developers to write extensions without modifying the core or having to submit their code for review. Installing an extension typically consists of adding a line to the configuration file, though in some cases additional changes such as database updates are required. Wikipedia:MediaWiki(2009)

JavaScript
Media wiki allows a special page MediaWiki:Common.js that is loaded every time a page is displayed. It is not editible by users and is created by the system admin.

JavaScript inpage
In here I'd love to include a basic javascript that demonstrates how it can be included on a web page, something like..



Reference: wikibooks:MediaWiki Developer's Handbook/Add JavaScript (2009) - really cryptic and really no help at all yet :)

However Media wiki describes an extension (Extension:Javascript, 2009, June 27) which I must try (I want to add a text size JavaScript element).

Templates


and call it at the bottom of a wiki page using 

Examples
My templates Specify an APA reference at the footer of each page:
 * author Template:APAFooterAuthor,
 * me as author :) Template:APAFooter

Extensions
Extensions usually are implemented in two parts
 * 1) First, some additional php files need to be uploaded to the server (that use wikiMedia hooks) to intercept the code and do the special things you want to do (e.g. GeSHI formats programming code using a code tag, cite allows for the ref tag to be used on a wiki page)
 * 2) Next a line of code is added to LocalSettings.php (on the Server) require_once('extensions/Cite/Cite.php');
 * 3) Finally the tags are added to the wiki page to call the new feature.

Examples

 * Cite extension (Arnfjörð Bjarmason,2009) - adds two parser hooks &lt;ref> and &lt;reference /> to add citations to wiki pages.
 * GeSHI extension (Vibber, Starling, & Church (2009).

Widgets
Widgets extension allows adding widgets to wiki by just creating pages in Widget namespace. (MediaWiki:Extension:Widgets, 2009). For the widgets to work, the widget extension (some additional php code) must be installed on your server first. As there is potential for unauthorised access to your data, permission to create a widget (in the widget namespace) is set in the LocalSettings file)

The cool thing about a widget is that you can extend Media Wiki inside the wiki rather than creating additional PHP code to upload separately to the server.


 * MediaWiki Widgets ( http://www.mediawikiwidgets.org/Main_Page )

Example

 * YouTube widget (Koren, 2008) - allows you to add YouTube video player to your wiki page

Miscellaneous tools

 * Microsoft Office Word 2007+ Add-in For MediaWiki
 * http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8e519637-afb0-4134-a91f-7b0ebea8d933#Overview
 * Open Office
 * File >Export> MediWiki (.txt)