TurnKey Linux Virtual Appliance Library

MediaWiki extensions

The following are notes for testing/using some of the extensions included in the MediaWiki appliance.
Please refer to the extensions documentation for details, no point in repeating them here...

Enabling/Disabling the extensions are done in /etc/mediawiki/extensions.php

FCKeditor: WYSIWYG editor for wiki pages

edit a page.
note: for advanced mediawiki configurations and using some of the other extensions (eg. ParserFunctions), you will need to disable FCKeditor on those pages.

ParserFunctions: Enhances parser with logical functions

{{#time: Y-m-d }}
{{#expr: 1 and -1 }}

useful resources: ParserFunctions/Extended and Help:Extension:ParserFunctions

StringFunctions: Additional set of parser functions that operate on strings

{{#len:string}}

CategoryTree: Provides a dynamic view of the category structure as a tree

create categories

http://appliance_ip/index.php/Category:Blah

create pages in category

[[ Category:Blah ]]

and sub-categories...

<categorytree>Blah</categorytree>
<categorytree mode=pages>Blah</categorytree>

Renameuser: Special page allowing authorised users to rename user accounts

create user test, with user page content
rename user

note: an auto-redirect from the old to the new user name is also created

Preloader: Populate new pages with template content depending on namespace

/etc/mediawiki/extentions.php is already seeded with the following MediaWiki private namespaces:

$wgPreloaderSource[ NS_MEDIA ] = 'Template:Media';
$wgPreloaderSource[ NS_SPECIAL ] = 'Template:Special';
$wgPreloaderSource[ NS_MAIN ] = 'Template:Main';
$wgPreloaderSource[ NS_TALK ] = 'Template:Talk';
$wgPreloaderSource[ NS_USER ] = 'Template:User';
$wgPreloaderSource[ NS_USER_TALK ] = 'Template:User_Talk';
$wgPreloaderSource[ NS_WIKIPEDIA ] = 'Template:Wikipedia';
$wgPreloaderSource[ NS_WIKIPEDIA_TALK ] = 'Template:Wikipedia_Talk';
$wgPreloaderSource[ NS_IMAGE ] = 'Template:Image';
$wgPreloaderSource[ NS_IMAGE_TALK ] = 'Template:Image_Talk';
$wgPreloaderSource[ NS_MEDIAWIKI ] = 'Template:Mediawiki';
$wgPreloaderSource[ NS_MEDIAWIKI_TALK ] = 'Template:Mediawiki_Talk';
$wgPreloaderSource[ NS_TEMPLATE ] = 'Template:Template';
$wgPreloaderSource[ NS_TEMPLATE_TALK ] = 'Template:Template_Talk';
$wgPreloaderSource[ NS_HELP ] = 'Template:Help';
$wgPreloaderSource[ NS_HELP_TALK ] = 'Template:Help_Talk';
$wgPreloaderSource[ NS_CATEGORY ] = 'Template:Category';
$wgPreloaderSource[ NS_CATEGORY_TALK ] = 'Template:Category_Talk';

edit the user homepage template

http://appliance_ip/index.php/Template:User

create new user page (template text will "preloaded")

CharInsert: JavaScript character insert boxes used on edit type pages

create the following:

http://appliance_ip/index.php/MediaWiki:Edittools

insert which ever charaters you desire (refer to MediaWiki's Edittools as a reference)

edit a page, the charaters will appear at the bottom of the page.

ConfirmEdit: Math captcha

The default triggers are as follows:

$wgCaptchaTriggers['edit']          = false;
$wgCaptchaTriggers['create']        = false;
$wgCaptchaTriggers['addurl']        = true;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;

note: registered bots and sysops are not affected by the above mentioned triggers due to $wgGroupPermissions (configurable)

Gadgets: JS/CSS-based gadgets

create test gadgets definition

http://appliance_ip/index.php/MediaWiki:Gadgets-definition

* test|test.css

create test gadget (don't display logo)

http://appliance_ip/index.php/MediaWiki:Gadget-test.css

#p-logo {
    display:none;
}

test gadget

preferences -> gadgets -> choose test

refresh: logo dissapears

SyntaxHighlight_GeSHi: adds <source> tag to present formatted source code

<source lang="python" line=1>
# Hello World in Python

def main():
    print "Hello World!"

if __name__ == '__main__':
    main()
</source>

note: remove line=1 to not display line numbers

Cite: Create footnotes

blah blah blah... <ref>A. Hacker, Phrack#1, (blah...), 01.1</ref>
foo foo foo foo... <ref>A. Hacker, Phrack#2, (foo...), 02.2</ref>