Wookieepedia:Technical notes

This is a collection of technical notes that are of little interest to most Wookieepedians, but may be found useful by people wanting to implement them on other wikis.

CSS and JavaScript
The skin-independent CSS resides in MediaWiki:Common.css, while things specific to the default monobook skin reside in MediaWiki:Monobook.css.

Unlike Common.css, MediaWiki:Common.js is not a standard MediaWiki feature at this point. It is implemented by small stub code in MediaWiki:Monobook.js and MediaWiki:Myskin.js. However, the bulk of the code on Wookieepedia resides in Common.js.

Main Page coloring
If the Wookieepedia Main Page is copied to another wiki, it will appear uncolored.

Our Main Page uses the random choice extension (specific to Wikia) to implement rotation between two color themes: "sky" and "water". The CSS code for both can be found in Common.css. The prefix "mp2" means "Main Page, version 2".

Template:T and Template:F
Those are pure meta-templates, and both are extremely simple. The first template outputs its first argument, the second is blank. As unlikely as it seems, they are actually useful and quite extensively used here on Wookieepedia, even though Wikia now uses the ParserFunctions extension that accomplishes the same tasks with much prettier code.

The most common hack involving t takes the following form:

thentext

It takes advantage of the way MediaWiki parses template parameters. If testtext is not an empty string, two parameters will be passed: parameter 1, which is thentext, and parameter 1testtext, which is elsetext, which will yield thentext. Otherwise, MediaWiki will disregard thentext and consider elsetext as parameter 1, yielding elsetext as the result.

The semantics of this template call are:
 * If testtext is not blank, then thentext.
 * Otherwise, elsetext.

This is now completely superseded by ParserFunctions, with way more intuitive syntax:

Infoboxes
Again, the styles are out there in the CSS.

Meta-templates
The templates used in infobox construction are: slh, sls, sld, and slf. The letters "sl" mean "substitutable list" (as opposed to the legacy "pl*" templates, where the "pl" stood for "planet list" as those meta-templates were originally designed for planets).

The "h", "s", "d", and "f" stand for "header", "section", "dark" and "footer". The "sld" template originally had an "sll" counterpart, which rendered a cell light grey as opposed to dark grey, but now it's just a redirect as the template allows one to explicitly specify the background color.

In addition, t needs to be copied, as sld uses the legacy hack described above to render a row invisible if the parameter is blank or omitted.

Whenever a meta-template is changed, all infoboxes using it need to be "regenerated" from the "source", as they use template substitution.

Hiding
The "[Hide]" button does not appear if JavaScript is disabled.