![]() | This is an information page. It is not an encyclopedic article, nor one of Wikipedia's policies or guidelines; rather, its purpose is to explain certain aspects of Wikipedia's norms, customs, technicalities, or practices. It may reflect differing levels of consensus and vetting. |
Transclusion refers to the inclusion of the content from one document within another document by reference. In Wikipedia, transclusion means the MediaWiki software retrieving the content from a source page, often a template, and incorporating it into the content of a target page.
Similar to creating a wikilink using double square brackets (
), a page can be transcluded as a template by enclosing its title in double curly braces or double curly brackets: [[Pagename]]
{{Namespace:Pagename}}
. Any changes made to the source page, or template, are automatically reflected on all pages that include the transcluded content.[a]
If no namespace is specified, 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 (:
). For example:
{{Pagename}}
is the same as {{Template:Pagename}}
{{Stochastic processes}}
will transclude from the page Template:Stochastic processes{{:Stochastic processes}}
will transclude from the page Stochastic processes (an article, in the Main namespace){{Wikipedia:Assume good faith}}
will transclude from the page Wikipedia:Assume good faithTransclusion and what content it includes or excludes can be modified by using the invisible wikitext tags <noinclude>
, <onlyinclude>
, <includeonly>
, and <section>
on the source page, as further outlined in § Transclusion markup.[b] The first three tags enable § Partial transclusion, as opposed to the default behavior of double curly braces, which will transclude the entire source page's content. For § Selective transclusion, the <includeonly>
or <section>
tags can be used and sections of the source page named, then using parser functions the template can be called with the section name as a parameter: {{#section:Pagename|Sectionname}}
.
Transclusion events occur each time the target page is loaded and the template is rendered. A related event is Substitution, where a template call is replaced with its transcluded source content at the time it is invoked in a one-time inclusion of the content. Unlike transclusion, which continuously updates the target page with changes from the source, substitution results in a one-time inclusion of the content, meaning that subsequent updates to the source content will not be reflected in the target page. For example, a template call for {{Pagename}}
with the subst:
prefix results in the substitution template call {{subst:Pagename}}
. When invoked, this template is replaced, also referred to as substituted, with the actual wikitext of the source page at the time of the call, thereby making it a permanent part of the target page.[c]
It is possible to transclude content from Wikidata into Wikipedia articles or other wikis.
Cite error: There are <ref group=lower-alpha>
tags or {{efn}}
templates on this page, but the references will not show without a {{reflist|group=lower-alpha}}
template or {{notelist}}
template (see the help page).