Download the Liquipedia app here!Download the Liquipedia app to follow Brood War!Want personalized updates on Brood War esports? Download the Liquipedia app on iOS or Android to never miss your favorite tournaments and matches!
Liquipedia app match pages updated! Liquipedia app match pages are overhauled! Download on Android or iOS! Liquipedia app's match pages got completely revamped with game data, standings, VODs and more! Download the the latest version on iOS or Android and read our update blog here.

Help:Transclusion

From Liquipedia StarCraft Brood War Wiki

Transclusion refers to the inclusion of the content of a document into another document by reference. In the context of this wiki, it is the use of the template functionality of MediaWiki to include the same content in multiple documents without having to edit those documents separately. This is done by placing a reference to the source page in the wikitext of the target page. Changes made to a page are automatically reflected on all pages into which that page has been transcluded.

The basic syntax used to produce transclusion in wikitext is {{Namespace:Name}}, which will be replaced by the content of the page named Namespace:Name when it is rendered on the user's display. If the referenced page name does not begin with a namespace identifier (Namespace:), it is assumed to be in the Template namespace. To refer to a page in the "Main" (article) namespace, it is necessary to prefix it with a colon (:).

It is also possible to pass parameters to a template, using the expanded syntax, which can affect what text in the template is rendered.

An alternative to transclusion is substitution, whereby the current content of the template is automatically copied into the wikitext of the target page on saving, and will then be an indistinguishable part of the saved page, independent of any later changes made to the template. The syntax for this is {{subst:Template name}}

How transclusion works[edit]

To transclude any source page (within a single MediaWiki project), include the following code in the target page:

{{SOMEPAGE}}

Whenever the target page A with this code is rendered, the engine will include in that place not the code itself, but the entire content of the source page B, SOMEPAGE.

Transclusion markup[edit]

  • noinclude. The markup <noinclude>...</noinclude> means that the text between the tags will not be transcluded onto another page, but will only appear on the page itself. This is useful for documentation.
  • includeonly. The markup <includeonly>...</includeonly> means that the text between the tags will only be used when the page is transcluded onto another page, and will not appear on the page itself. This can be useful, for example, for adding categories to pages transcluding a template, without adding the template itself to these categories.
  • onlyinclude. The markup <onlyinclude>...</onlyinclude> indicates that only text surrounded by "onlyinclude" markup should be transcluded onto another page. This is the most subtle of the partial transclusion tags because it often overrules the others. If there is at least one pair of "onlyinclude" tags on a page, then whenever this page is transcluded, it is only the material within the "onlyinclude" tags which gets transcluded. There can be several such sections, and within each such section, some material might be further excluded by "noinclude" tags, and might also be surrounded by "includeonly" tags so that it does not appear on the original page itself. But material outside the "onlyinclude" tags will be ignored when the page is transcluded onto another page. This can be useful, for example, to repeat a small part of one page on a second one: just surround the small part by onlyinclude tags, and transclude it onto the second page.