interwiki links to the English-language Wikipedia, you could define a link like “enwp”, which looks like the following:
http://en.wikipedia.org/wiki/$1
An interwiki link using this alias could then look like:
[[enwp:Rainbow|rainbow]]
The text “Rainbow” would get substituted into the URL, where the “$1” is — so the linked URL would be http://en.wikipedia.org/wiki/Rainbow.
And since it’s a link, you can include alternate link text (as shown in the example) — this is always recommended, because otherwise the interwiki alias (in this case, “enwp”) will show up in the link text.
How do you define interwiki aliases? You can do it directly in the database, by adding to the “interwiki” table, but the recommended way is to use the Interwiki extension:
https://www.mediawiki.org/wiki/Extension:Interwiki
This extension provides a nice graphical interface, at Special:Interwiki, for managing the set of interwiki aliases on a wiki.
On Wikipedia, interwiki links to the other language Wikipedias, if they’re placed on the bottom of the page and contain a known language code as their interwiki alias, will automatically turn into helpful links in the sidebar to the article’s equivalents in other languages. (These are actually referred to as “interlanguage links”.) If you want to set up this capability on your wiki — if you have a Wikipedia-style setup, with multiple wikis for the same content in different languages — you can do that by adding the following to LocalSettings.php:
$wgInterwikiMagic = true;
$wgHideInterlanguageLinks = false;
Templates
Templates are an integral part of the MediaWiki system. Technically, they’re nothing more than pages that can substitute in values when they’re transcluded, but that simple functionality opens up a world of possibilities. Templates are all stored in the “Template:” namespace (namespaces are described here ). At their most basic, templates can simply be a piece of text. For instance, you could have a perfectly valid template called “Hello”, whose page, located at “Template:Hello”, contains just the following text:
Hello, everybody!
Once that page was created, you could put the following text anywhere in any wiki page:
{{Hello}}
Placing double curly brackets around a text makes MediaWiki look for a template with that name, and then place its contents on the page if the template is found. In this case, the call would be replaced by the text “Hello, everybody!”.
Here’s an example of a more complex template, “Needs work”, which looks more like the way templates in MediaWiki usually work. The “Needs work” template is meant to provide a simple way for users to tag pages that have problems. On the page “Template:Needs work”, we could have the following code:
This is the "Needs work" template. You can pass to it the field "Problem".
This page needs work, for the following reasons(s): {{{Problem|}}}.
Let’s go through this code.The
tag is meant to hold text that is only displayed when users look at the template page itself; it should be text that describes the template. The
tag, on the other hand, holds text that will only be displayed on the page where the template is transcluded/called. Neither tag is necessary (though they’re both recommended); and any text not contained in either tag will be displayed both on the template page and on pages in which it’s called. Thus, the page "Template:Needs work" would display just this:
This is the "Needs work" template. You can pass to it the field "Problem".
A user, seeing a page that needed work, could add a call to the "Needs work" template to the top of such a page, so it looks like this:
{{Needs work|Problem=Incorrect information}}
A bat is a kind of bug that lives in caves. It has glowing eyes that can shoot lasers!
The page would then get displayed