Extension:SkinByUrl2

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
Skin-by-URL 2
Release status: beta
Implementation Skin
Description Force use of a particular skin based on the URL used to access the wiki
Author(s) (gleneiveytalk)
Latest version 0.1
MediaWiki 1.15
License AGPLv3
Download
http://github.com/gleneivey/skin-by-url-2/blob/master/README
Example http://wiki.wontology.org/wiki/help.php?title=WmHelp:AboutWontologyOrg
Hooks used
OutputPageParserOutput
GetLocalURL
Translate the SkinByUrl2 extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?[edit]

Skin-by-URL 2 will cause the skin used to display a page to be determined by the PHP script name in the wiki URL. For example, MediaWiki URLs normally use the script name "index.php" before the page-title portion of the URL. This extension examines request URLs for a script name other than "index", and if present, sets the output skin to one whose name matches the requested script name (if available).

Usage[edit]

Change links into your wiki which you want to control the display skin from their "normal" format of

 http://your.wiki.tld/wiki/index.php/Your_Article

or

 http://your.wiki.tld/wiki/index.php?title=Your_Article

to look like:

 http://your.wiki.tld/wiki/a_skin.php?title=Your_Article

The extension will also support "extra pretty" URL schemes like

 http://wiki.yoursite.tld/wiki/Your_Article
 http://wiki.yoursite.tld/Your_Article

as long as you use the completely explicit URL format ("a_skin", above) when creating links that include a skin-selecting script name.

Download instructions[edit]

The public repository for Skin-by-URL 2 is on GitHub at http://github.com/gleneivey/skin-by-url-2

Installation[edit]

Place the skin-by-url-2 files in a directory of the same name under "extensions" in your MediaWiki installation, and add the following to your LocalSettings.php:

$wgParserCacheType = CACHE_NONE;
$wgUsePathInfo = false;
require_once( "$IP/extensions/skin-by-url-2/skin-by-url-2.php" );

In order for this extension to work, in addition to installing the extension, administrators must create links (tested) or URL aliases (will probably also work) from their desired skin-specific script names to the default one (e.g., from "simple.php" to "index.php"). Yes, this is a little kludgey and adds an extra step to restoring a completely destroyed wiki installation, but it is easy to understand and manage. Note that the names of the links used in place of "index.php" must still end in ".php" to be recognized (or in whatever value you've set for $wgScriptExtension).

See the README file for more detailed installation instructions and additional options.

See also[edit]

Though it shares no code, Skin-by-URL 2 is a functional clone of Extension:SkinByURL.