ৱিকিপিডিয়া:Transclusion
From Wikipedia, the free encyclopedia
Transclusion means the inclusion of the content of one document in another document by reference. In Wikipedia, it refers to a function of the MediaWiki software that allows the content of one page to be included in the content of another page, by placing a reference to the source page in the wikitext of the target page. A page that is intended to be transcluded into other pages is called a template. Changes made to a template are automatically reflected on all pages into which that template has been transcluded.
The basic syntax used to produce transclusion in wikitext is {{Template name}}
which causes that to be replaced by the content of the template page named Template name when it is rendered on the user's display. For example, by entering {{Like}}
in wikitext, what is displayed is the content of TEMPLATE:Like; specifically: Like.
It is also possible to pass parameters to a template, using the expanded syntax described at Help:Template, which can affect what text in the template is rendered. For example, to highlight text like this, the text-to-be-highlighted is passed as a parameter to the highlight template: {{highlight|this}}
.
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}}