Template: Difference between revisions

From WikiMD's Wellness Encyclopedia

CSV import
No edit summary
Tag: Manual revert
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 13:19, 18 March 2025

Template is a feature in MediaWiki that allows for the creation of reusable content. Templates are used to insert the same content in multiple pages, to create visual structures, and to standardize pages. They are a fundamental part of the MediaWiki software, which powers websites like Wikipedia and Wikimedia Commons.

Overview[edit]

A template is a page created specifically for transclusion, a process that allows a piece of the same content to be included in multiple pages. When a template is updated, all pages that use the template will be automatically updated with the new content. This makes templates a powerful tool for maintaining consistent content across a large number of pages.

Templates are created using the "Template:" namespace, and their content is written in Wikitext, the markup language used by MediaWiki. The content of a template can include text, formatting, links, and other templates.

Usage[edit]

To use a template in a page, the name of the template is included in double curly braces, like this: Template:Template name. This is known as a template call. When the page is viewed, the MediaWiki software replaces the template call with the content of the template.

Templates can also be used with parameters, which are values that can be passed into the template to customize its content. Parameters are included in the template call, separated by vertical bars, like this: Template:Template name.

Types of Templates[edit]

There are several types of templates used in MediaWiki:

  • Content templates are used to insert the same content in multiple pages. For example, a content template could be used to insert a standard warning message in multiple pages.
  • Structure templates are used to create visual structures, such as infoboxes and navigation boxes. These templates often use complex table formatting.
  • Function templates are used to perform complex functions, such as calculations and string manipulation. These templates use the ParserFunctions extension of MediaWiki.

See Also[edit]



   This article is a MediaWiki-related stub. You can help WikiMD by expanding it!