Extension:CustomPage

The CustomPage extension allows building Special Pages with a completely customized display. Essentially, it's a framework for creating a Special Page that does not load any of the current skin's styles, but still has access to core MediaWiki features. This is useful for displaying a page within the wiki that can be built from the ground up. For example, you may want to build a custom home page that doesn't use the wiki's default skin. This extension will allow you to create any number of Special pages that use skins you create that are derived from the CustomPage skin.

Configuration parameters

 * $wgCustomPageSkins: Associative array with the key set to the name of a Special custom page and the value set to the name of its intended custom skin.

Default (no configuration)
If the extension is installed correctly, you should be able to navigate to  and see a completely blank page. However, if you look at the source of the page, you will see that the wiki is loading lots of stuff behind the scenes.

Add some HTML
A blank page doesn't do much for anybody, so add some HTML to your page. You can do this by creating a new Skin in your wiki's  directory. Then, add a php file, where the file name precisely matches the name of that directory, followed by the  extension. Finally, add a line in your  that adds an element to the   array whose key matches the name of the special page you would like to create (the part after Special:) and whose value matches the name of the directory you just created.

Example
In your  directory, create a new directory called. In it, create a file, which must be named. In the file, add some php and html. Here's a simple example:

As you can see, you are able to use the nifty MediaWiki built-in helper classes.

Then, in your, add the following line:

Now, navigate to  and you should see a message that says something like "This page is intentionally left blank.".

Add some LESS
An unstyled HTML page looks kind of boring, but you can add some LESS by creating a file named  in your skin's subdirectory.

Example
In that  directory, add a file named. Add some LESS, like:

Now, navigate to  and you should see that message centered on a hideously green background.

Add some JS
You can add some JS by creating a file by creating a file in camelCase that matches your skin's name, and put it in your skin's subdirectory.

Example
In that  directory, add a file named. Add some JavaScript, like:

Multiple special pages
You can use this extension to easily create many custom Special pages within your wiki. Just add additional elements to the  array.