Jump to content

Help:Transclusion/How Transclusion Works: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Undid revision 759572188 by 2600:1005:B04F:1B11:787E:764D:3C95:69D9 (talk) rv/v
Blanked the page
Line 1: Line 1:
{{navbar|Wikipedia:Transclusion/How Transclusion Works|plain=1}}

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

<code><nowiki>{{SOMEPAGE}}</nowiki></code>

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.

<div style="{{divstylenone}}">
[[File:Transclusion-multiple-foo.svg]]
</div>

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 the template's contents should appear. When the template is edited, the rendering of that template on the target pages is updated as well. For example, you create a (template) page in Wikipedia with your home mailing address and then transclude that template not only on your page, but all your friends' pages, too. Later, after moving to a new house, you then update your address template and the ''new'' address will automatically appear on all your friends' pages.

Revision as of 01:12, 19 April 2017