MeritBadgeDotOrg:Transclusion

From MeritBadgeDotOrg

(Difference between revisions)
Jump to: navigation, search
(New page: '''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 o...)
Current revision (11:12, March 26, 2008) (edit) (undo)
(Wikipedia -> MeritBadgeDotOrg)
 
Line 1: Line 1:
-
'''[[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 [http://en.wikipedia.org/wiki/MediaWiki MediaWiki] to include the same content in multiple documents without having to edit those documents separately.
+
'''[[Transclusion]]''' is generally the inclusion of the content of a document into another document by reference. In the MeritBadgeDotOrg context, it is the use of the template functionality of [http://en.wikipedia.org/wiki/MediaWiki MediaWiki] to include the same content in multiple documents without having to edit those documents separately.
{{MeritBadgeDotOrg:Transclusion/How_Transclusion_Works}}
{{MeritBadgeDotOrg:Transclusion/How_Transclusion_Works}}
-
==Examples==
+
== Example ==
-
[[MeritBadgeDotOrg:Transclusion/How_Transclusion_Works]] and [[Template:POTD]] are transcluded to this page using <nowiki>{{MeritBadgeDotOrg:Transclusion/How_Transclusion_Works}}</nowiki> and <nowiki>{{POTD}}</nowiki>.
+
{{expand2|section}}
-
 
+
-
<center>{{POTD}}</center>
+
-
 
+
-
[[Template:Flu]] and text [[Spanish flu research]] are transcluded to [[Spanish flu]] using <nowiki> "{{Flu}}" and "{{:Spanish flu research}}" </nowiki> respectively. Note that transcluding prose in articles is a debated issue. The alternative is to create a short introduction and link to the prose.
+

Current revision

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

For example, you might decide to place a welcome message on every newcomer's Talk Page. Transclusion creates a "live" link between the "template" page and the target page(s) upon which it appears. When the template is edited, all the other pages are edited 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.

Example

Please help improve this section by expanding it.
Further information might be found on the talk page.
Personal tools
language