Configuring templates
From Pirates@Home
Templates are small parts of articles which can be inserted into any other article (usually into many articles) to provide common content or function. They are similar to the #include statement in C and related languages.
Templates are a part of the content of the wiki, so the initial configuration does not include templates — you have to create your own, or import them from another wiki project.
Templates are kept in the "Template" namespace. To insert the content of a template you simply surround the template name with "{{" and "}}".
Further details may be found at Meta:Help:A_quick_guide_to_templates
Examples
A common use for a template is to mark a page as a "disambiguation" page, which is a page which is used to distinguish between two or more topics which use the same or similar names. When the template Template:Disambig exists on your wiki, then inserting "{{Disambig}}" into an article includes the text in that template into the article, marking it as a disambigutation page.
Another use for a template is quicker categorization. If a set of articles should all be classified under several categories, you can put the [[Category:xxx]] statements all in one template, and then simply include that one template in your article.
Borrowing Templates from another project
One way to quickly get a working template is to "borrow" one from another project. The steps are:
- On the first project, where the template is defined, go to the list of Special pages and find "Export pages"
- Enter the name(s) of the page(s) you wish to export, one per line. For templates you must remember the Template: namespace prefix.
- When you submit the query your browser will be presented with an XML page which contains all the exported articles. Use the "Save As..." feature of the browser to save this XML web page to a file, eg. "templates.xml"
- On the second project, go to the list of Special pages and find "Import". You must be a SysOp to use this feature. Use the Browse button to find the file you just exported and import it into the second wiki.
- You will likely need to edit the content of the template. Templates from the Wikipedia, for example, have interwiki links to the Wikipedia in other languages, but these links will likely not work on your wiki unless you also have the same interwiki links defined. You can simply remove those links.
