Wikipedia:Transclusion

Transclusion is when the contents of one page or document is included within another. In the Wikipedian context, 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.

How transclusion works

To transclude any source page (within a single MediaWiki project, such as simple:Wikipedia) within another target page, include the following code:

{{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.

This would be a pretty neat trick if it only meant that you didn't have to copy-and-paste from one page to another. For example, you might decide to copy a welcome message to every newcomer's Talk page; you could do this with transclusion (though it might not be the best thing to do!).

But transclusion creates a "live" link between the "template" page and the target page where it appears. When the template is edited, all the other pages change, too.

For example, you might decide to create a (template) page with your mailing address and include that template on not only your page, but all your friends' pages, too. When you move your television and couch to another apartment, you will change your address template, and automatically, that new information will appear on all your friends' pages.

Examples

This very page uses template transclusion. The section above entitled "How transclusion works" is actually transcluded from the page Wikipedia:Transclusion/How Transclusion Works. This is done using the MediaWiki markup {{Wikipedia:Transclusion/How Transclusion Works}} to include it.

Pages related to MediaWiki transclusion

Templates

Related pages

🔥 Top keywords: Main PageSpecial:Search0Slash (punctuation)BlackSpecial:RecentChanges4 (number)DavidSOLID (object-oriented design)Wikipedia:AboutFile:Sexual intercourse with internal ejaculation.webmHelp:ContentsHelp:IntroductionLisa Sparxxx2023 UEFA Champions League FinalColour24-hour clockAdolf Hitler UunonaBismillahir Rahmanir Raheem6 (number)T. N. SeshanFile:ASCII-Table-wide.svg20 (number)Poor Things (movie)United StatesCristiano RonaldoList of people who have walked on the MoonAli Malikov50 (number)17 (number)The Valley (2024 TV series)GrassList of mathematical symbolsList of U.S. states and territories by time zone8 (number)List of countries by areaWikipedia:Simple talkList of largest Hindu templesRama