Help:Transclusion/How Transclusion Works: Difference between revisions

Content deleted Content added
grammar; changed example, as we don't typically share editor street addresses on WP, especially not en masse. Replaced with something uncomplicated but still in context of WP
Tag: Reverted
oops, forgot to mention the other two examples, target pages P and Q too
Tag: Reverted
Line 6:
Whenever a target page with this code (<code><nowiki>{{SOURCEPAGE}}</nowiki></code>) is rendered, the engine will include the entire content of <code><nowiki>SOURCEPAGE</nowiki></code> in the target page.
 
In the example below, let theus start with target page be '''A''' and transclude <code><nowiki>SOURCEPAGE</nowiki></code> be '''B'''. <br />
If <code><nowiki>{{B}}</nowiki></code> is renderedtranscluded in '''A''', then the engine will include ''in that place'' not the code (<code><nowiki>{{B}}</nowiki></code>) itself but the content of source page '''B''' (which in this example, consists of only one word, foo).
 
The top row shows how the target page '''A''' renders, while the bottom row shows the code required to transclude the source page within the target page. Note that the position of the code determines how each of the target pages '''A''', '''P''', and '''Q''' will render.
If <code><nowiki>{{B}}</nowiki></code> is rendered, then the engine will include ''in that place'' not the code (<code><nowiki>{{B}}</nowiki></code>) itself but the content of source page '''B''' (which in this example, consists of only one word, foo).
 
The top row shows how the target page renders, while the bottom row shows the code required to transclude the source page within the target page. Note thatcontent foo will not be highlighted nor boxed on the target page.
 
<div style="margipadding: 0.5em;">[[File:Transclusion-multiple-foo.svg]]</div>