Help:Templates

From Encyclopedia Ermariana
Jump to navigation Jump to search

Some articles that deal with similar subjects contain common identical parts: Links, category tags or tables. MediaWiki allows such elements to be abstracted into a Template, which will save the effort of rewriting or updating the code in multiple pages.

Templates are included with the code

{{TemplateName}}

Which will include the contents of the page Template:TemplateName in the page as if it was actually copied and pasted in that place. When the page Template:TemplateName is changed, the template also changes in all the pages that use it. This is why you should be careful when editing a template, as you could be changing the appearance of hundreds of entries.

All template pages are prefixed by the Namespace "Template"; to see template "Example" by itself, just go to the article titled Template:Example.

Categories and Templates

If a template is part of a Category, all pages that use it are also added to this category. Be careful when adding or removing a heavily used template to or from a category.

Category link updates

When a template's category links are changed, hundreds of category memberships may change at the same time. These category links are stored separately and have to be updated by the MediaWiki by parsing each page that uses it in turn.

Since version 1.6.3. (installed here on April 20th 2006), MediaWiki uses a Job queue to perform such extended updating tasks. The software updates one page whenever somebody visits this site, in order to asynchronize the task.

The result: If you have added a template to a category, it will take some time for all pages to be updated. Browse the site a bit in the meantime to speed up the process. The current job queue length is shown in the Statistics page.