Transclusion


By The original uploader was Xiong at English Wikipedia (Transferred from en.wikipedia to Commons.) [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons
Parts of document B are transcluded to document A" src="/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-ajax-loader-pik-blue.gif?Transclusion_simple.svg.png"

Transclusion means the inclusion of a certain part of a document into another. The template of a transclusion is called transclude. If the content of the transclude is changed, the alteration is visible on all sites containing the transclusion.

Scope of application

By using transclusions, you can maximize the consistency in your wiki, minimize redundancy, and optimize your workflows and code. The use of transclusions is especially indicated for the following cases:

  • Banner: It will be displayed on other pages through transclusion
  • Table: Parts of it or whole tables will be displayed on other pages through transclusion

The functions of transclusions

To use a transclusion, the transclude has to be implemented on the target page by entering the transcludes name in curly braces.

{{Transclude}}

This causes the target page to show the content of the transclude. Future changes made on the transclude will also appear on the target page.

Transclusions with Parameters

It is possible to use both named and unnamed parameters with transclusions.

Partial transclusion

By using the tags "noinclude", "onlyinclude" and "includeonly" it is possible to only transclude parts of a document.

  • <noinclude>...</noinclude>
  • Allows to exclude the content between the tags of the transclusions
  • <includeonly>...</includeonly>
  • Allows to transclude the content between the tags, but doesn't show them on the transclusion template.
  • <onlyinclude>...</onlyinclude>
  • Allows only to transclude the content between the tags.

Classic revisions with MediaWiki

Further information can be found on mediawiki.org

Attachments

Discussions