Home Page - YouTube Channel



Wikipedia:Transclusion - Simple English Wikipedia, the free encyclopedia

Wikipedia:Transclusion

From the Simple English Wikipedia, the free encyclopedia that anyone can change

Shortcut:
WP:TRANS

Transclusion is generally the inclusion of the content of a document into another document by reference. 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.

Contents

[change] How transclusion works

To transclude any source page (within a single MediaWiki project, such as en: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.


[change] Examples

This very page uses template transclusion. The section above entitled "How transclusion works" is actually transcluded from the document Wikipedia:Transclusion/How_Transclusion_Works. That section is included by reference, by using the MediaWiki markup {{Wikipedia:Transclusion/How_Transclusion_Works}} to include it.

The template Flu at Template:Flu and text Spanish flu research at Spanish flu research are transcluded to Spanish flu using "{{Flu}}" and "{{:Spanish flu research}}" respectively.

Note that transcluding prose (not templates) in the main (article) namespace (such as the "{{:Spanish flu research}}" example) is currently a debated issue (see the links in the following sections). The alternative for substantial articles is to put a short introduction in the linking article and add a normal wikilink to the target, probably using the Template:Main or Template:Further templates.

[change] Pages related to MediaWiki transclusion

[change] Templates

[change] See also

In other languages

Wikipedia HTML 2008 in other languages

100 000 +

Česká (Czech)  •  English  •  Deutsch (German)  •  日本語 (Japanese)  •  Français (French)  •  Polski (Polish)  •  Suomi (Finnish)  •  Svenska (Swedish)  •  Nederlands (Dutch)  •  Español (Spanish)  •  Italiano (Italian)  •  Norsk (Norwegian Bokmål)  •  Português (Portuguese)  •  Română (Romanian)  •  Русский (Russian)  •  Türkçe (Turkish)  •  Українська (Ukrainian)  •  中文 (Chinese)

10 000 +

العربية (Arabic)  •  Български (Bulgarian)  •  Bosanski (Bosnian)  •  Català (Catalan)  •  Cymraeg (Welsh)  •  Dansk (Danish)  •  Ελληνικά (Greek)  •  Esperanto  •  Eesti (Estonian)  •  Euskara (Basque)  •  Galego (Galician)  •  עברית (Hebrew)  •  हिन्दी (Hindi)  •  Hrvatski (Croatian)  •  Magyar (Hungarian)  •  Ido  •  Bahasa Indonesia (Indonesian)  •  Íslenska (Icelandic)  •  Basa Jawa (Javanese)  •  한국어 (Korean)  •  Latina (Latin)  •  Lëtzebuergesch (Luxembourgish)  •  Lietuvių (Lithuanian)  •  Latviešu (Latvian)  •  Bahasa Melayu (Malay)  •  Plattdüütsch (Low Saxon)  •  Norsk (Norwegian Nynorsk)  •  فارسی (Persian)  •  Sicilianu (Sicilian)  •  Slovenčina (Slovak)  •  Slovenščina (Slovenian)  •  Српски (Serbian)  •  Basa Sunda (Sundanese)  •  தமிழ் (Tamil)  •  ไทย (Thai)  •  Tiếng Việt (Vietnamese)

1 000 +

Afrikaans  •  Asturianu (Asturian)  •  Беларуская (Belarusian)  •  Kaszëbsczi (Kashubian)  •  Frysk (Western Frisian)  •  Gaeilge (Irish)  •  Interlingua  •  Kurdî (Kurdish)  •  Kernewek (Cornish)  •  Māori  •  Bân-lâm-gú (Southern Min)  •  Occitan  •  संस्कृत (Sanskrit)  •  Scots  •  Tatarça (Tatar)  •  اردو (Urdu) Walon (Walloon)  •  יידיש (Yiddish)  •  古文/文言文 (Classical Chinese)

100 +

Nehiyaw (Cree)  •  словѣньскъ (Old Church Slavonic)  •  gutisk (Gothic)  •  ລາວ (Laos)