Mediawiki template description

From AFSWiki

(Redirected from Template)
Jump to: navigation, search

A template is a feature in the wiki software, which may be included in a typical wiki article or category.

This article briefly describes how mediawiki treats templates. For a more complete description, see the mediawiki manual.

Purpose of a template

A template is used in place of literal text or graphics when it's intended that the collection of text (and/or graphics) be repeated in a variety of places. A template helps to keep content on the AFS Wiki DRY-- or centralized in one place, so that updates are only required in one place. Any article which is tagged with the template then automatically displays any content from that template. If the template itself is updated, than any article tagged with the template is updated automatically.

Example of a template

Notice.png
Some words.

This example of a template includes both a picture and text. If this template were attached to 50 articles, then updating the template itself would then automatically update all 50 articles which link to it. This helps tremendously in keeping AFS Wiki articles DRY.

How to use templates

Templates can be created much like articles are typically created. When creating an article, you simply type the name of the new article in the form:

[[ new article name ]]

When creating a new template, the format is:

{{ new template name }}

Often, articles tagged with a template should also be added to a category. To add all tagged articles to a category, (but not add the template itself), the following text should be appended to the end of the template text:

<includeonly> [[Category: category name]] </includeonly>
Personal tools
May 24 2012
Search Tip
  • "Go" links directly to page
  • <Enter key> = "Go"
  • "Search" displays full text search results