Help:Transclusion

From Meta, a Wikimedia project coordination wiki
(Redirected from Transclusion)
Jump to: navigation, search
Detailed reference page on this subject: Help:Template.

Transclusion refers to the process by which the entire contents of a page are inserted on to another page for the sake of convenience, speed of editing and/or tidiness of the source wikitext. The process works by applying the title of the page to be transcluded, with two braces {{}} on either side and sometimes a colon.

Templates[edit]

Pages created for the sole purpose of being useful to transclude are known as templates. Templates come in many varieties; some templates constitute generic messages that can be quickly and easily sent, while others contain pieces of text that are used in mass quantities. The use for these quick pieces of text or code are almost limitless, and there are literally hundreds of thousands in current use all over Wikimedia. They have their own namespace, Template:.

The braces assume, and it is implied by default, that the template namespace is to be transcluded; i.e., the syntax assumes that {{FOO}} refers to Template:FOO. However, all kinds of pages can be transcluded in every namespace so long as the namespace is specified: e.g., {{Meta:Help}} would be a viable and workable transclusion. Because of template: vs (main) confusion when transcluding, pages with no namespace prefix, as this one (Transclusion), are transcluded with a colon preceding the page name, like this: {{:Transclusion}}.

Link that is created[edit]

It is important to remember that transclusion creates a very real and direct link between the target page and the transcluded one; when the source page is changed, the transcluded text is changed with it. This especially applies to templates that are in mass use; many pages can be altered very radically by a small change. The volatility of this situation should be considered when making changes.

It is possible to see what pages are transcluded on a page, and where a page is transcluded, by use of the "What links here" link in the toolbox in the left hand panel.

Examples[edit]

The following is an example of transclusion {{Information thread}}:

---


August 2016[edit]

Wikimedia-logo.svg 5-7: WikiConference India 2016 will take place in Chandigarh, India.

July 2016[edit]

Wikimedia-logo.svg 12: A new Wikipedia.org Portal page layout update is up on MediaWiki with a request for comments. Please take a look and ask your questions, if you have them, as we'll be closing out the discussion on July 19, 2016. If you'd like additional information on the Portal and the work that has been done to date, it's available here.
Wikimedia-logo.svg 11: Community Questions and Answers to FDC candidates are open until 17 July. Please ask your questions!

June 2016[edit]

Mediawiki-logo.png 30: The VisualEditor team is building a group of experienced contributors who can help smaller communities to set up their sites and optimize the editing experience. You can sign-up at the Community Taskforce page.
Wikimedia-logo.svg 29: The Wikimedia Foundation Board of Trustees announces approval of the Wikimedia Foundation's 2016-17 Annual Plan and Budget.
Wikimedia-logo.svg 29: The call for nominations for appointed seats to the FDC is now open. We are looking forward to candidates!
Wikimedia-logo.svg 24: The Wikimedia Foundation Board of Trustees announces the appointment of Katherine Maher as Wikimedia Foundation Executive Director.
Wikimedia-logo.svg 16: Due to a programming error, some Wikimedia project users may be logged out as a security precaution.
Mediawiki-logo.png 14: The Wikipedia.org portal team would like to add mobile app download badges near the bottom of the portal page and wants feedback and suggestions on the idea.
Commons-logo.svg 10: Commons' Picture of the Year committee is pleased to announce the results of the tenth Picture of the Year competition (2015).


---

Viewing that source will show that while that thread is complex, with a fair bit of text and a lot of use of code, all it takes is a simple application of {{Information thread}} here to transclude accurately, how it displays there. This is very handy for managing information on the wiki.

See also[edit]