Extension:WikiSkin

This extension allows the skin layout and content to be defined using normal wikitext articles instead of PHP script files. The special fields like personal tools and action links are all included with magic words. The extension is a single script which can be copied from wikiskin.php and is included in the LocalSettings.php file as usual.

MediaWiki already allows the CSS to be a wiki article, either MediaWiki:Wikiskin.css and also 1.9.x up allows MediaWiki:Common.css which is the preferred one to use.

Monobook Skin
The example below is an example of a wikitext skin which replicates the standard MonoBook layout, except that the links in the left bar are transcluded from an article called "Navigation". The title of the article to be used for the skin is defined in the $wgWikiSkin global variable.

 Views Personal tools

Conditional skin content
Here's some examples of making some of the skin components hidden depending on the environment. You'll need the ParserFunctions extension or similar for the #if function to work.

Don't show the page title on the main page, 

Only show the action buttons if "wiki" is in the domain name

Livelet Skin
The main reason for developing this extension was for creating skins which include Livelets to allow dynamic updating and efficient caching of content in the page. The following example skin is the same as above, but makes the transcluded navigation links in the left panel into a dynamic livelet so that the browser will request and cache it separately from the rest of the page. This is a big advantage if the navigation links are a large tree which would otherwise have to load every time a new page was visited.

 Views Personal tools

Change Log

 * Version 0.1.8 (2007-08-28): Templates can now be used in CSS articles
 * Version 0.1.6 (2007-07-18): Fixed a bug causing skin to revert after login/logout