Help page: Edit

Editing Help:Transclusion

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<noinclude>{{pp-vandalism|small=yes}}{{Pp-move-indef}}</noinclude>
+
<noinclude>
 +
{{pp-vandalism|small=yes}}
 +
{{Pp-move-indef}}
 +
</noinclude>
 
{{Broader|w:Transclusion}}
 
{{Broader|w:Transclusion}}
 
{{Information page|H:TRANS|BTW:TRANS}}
 
{{Information page|H:TRANS|BTW:TRANS}}
'''Transclusion''' means the inclusion of the content of one document within another document by [[w:Reference (computer science)|reference]].  In BattleTechWiki transclusion, the [[mw:MediaWiki|MediaWiki]] software will refer to the content of one page, the [[BTW:template|template]], for inclusion into the content of any other page, the target page.  Similar to the way any [[BattleTechWiki:Page name|page name]] can become a link by placing its name in double square brackets, any page name can become a template by placing it in double curly braces, '''<code><nowiki>{{</nowiki>''Namespace'':''[[BattleTechWiki:Page name|Pagename]]''}}</code>'''. Changes made to the template are then automatically reflected on all pages into which that page has been transcluded (though a [[BattleTechWiki:Purge|purge]] may sometimes be necessary).
+
'''Transclusion''' means the inclusion of the content of one document within another document by [[Reference (computer science)|reference]].  In BattleTechWiki transclusion, the [[MediaWiki]] software will refer to the content of one page, the [[BTW:template|template]], for inclusion into the content of any other page, the target page.  Similar to the way any [[wp:page name|page name]] can become a link by placing its name in double square brackets, any page name can become a template by placing it in double curly braces, '''<code><nowiki>{{</nowiki>''Namespace'':''[[BTW:Page name|Pagename]]''}}</code>'''. Changes made to the template are then automatically reflected on all pages into which that page has been transcluded (though a [[BattleTechWiki:Purge|purge]] may sometimes be necessary).
  
 
If the template's [[BTW:page name|page name]] does not begin with a namespace, it is assumed to be in the Template namespace. To refer to a page in the "Main" (article) namespace, it is necessary to prefix it with a colon (''':'''). Examples:
 
If the template's [[BTW:page name|page name]] does not begin with a namespace, it is assumed to be in the Template namespace. To refer to a page in the "Main" (article) namespace, it is necessary to prefix it with a colon (''':'''). Examples:
  
* '''<code><nowiki>{{Stochastic processes}}</nowiki></code>''' will transclude from the page [[:Template:Example]]
+
* '''<code><nowiki>{{Stochastic processes}}</nowiki></code>''' will transclude from the page [[:Template:Stochastic processes]]
* '''<code><nowiki>{{:Stochastic processes}}</nowiki></code>''' will transclude from the page [[Example]] (an article, in the Main namespace)
+
* '''<code><nowiki>{{:Stochastic processes}}</nowiki></code>''' will transclude from the page [[Stochastic processes]] (an article, in the Main namespace)
 
* '''<code><nowiki>{{BTW:Assume good faith}}</nowiki></code>''' will transclude from the page [[BattleTechWiki:Assume good faith]]
 
* '''<code><nowiki>{{BTW:Assume good faith}}</nowiki></code>''' will transclude from the page [[BattleTechWiki:Assume good faith]]
  
What will transclude from a page can be controlled with the tags <nowiki><noinclude>, <onlyinclude> and <includeonly></nowiki> placed in the source page wikitext. (See [[#Markup|markup]], below.)  The use of tags enables the template to transclude partially, otherwise the double curly braces will always transclude all content.  For ''selective'' transclusion the <nowiki><includeonly></nowiki> parts of the template are named (with the help of [[BattleTechWiki:Parser functions|parser functions]]) and that template is then called with the [[Help:Template#Parameters|parameter]] <code>transcludesection=''name''</code>.
+
What will transclude from a page can be controlled with the tags <nowiki><noinclude>, <onlyinclude> and <includeonly></nowiki> placed in the source page wikitext. (See [[#Markup|markup]], below.)  The use of tags enables the template to transclude partially, otherwise the double curly braces will always transclude all content.  For ''selective'' transclusion the <nowiki><includeonly></nowiki> parts of the template are named (with the help of [[wp:parser functions|parser functions]]) and that template is then called with the [[Help:Template#Parameters|parameter]] <code>transcludesection=''name''</code>.
  
Transclusion events occur every time the page is ''loaded'', when the template is rendered. Another use of the same mechanism is a one-shot ''[[Help:Substitution|substitution]]'' of the template call itself by its transcluded source page.  A template call <code><nowiki>{{</nowiki>''[[BattleTechWiki:page name#Namespace, pagename, and fullpagename|fullpagename]]''}}</code> with the "subst:" prefix <code><nowiki>{{</nowiki>subst:''fullpagename''}}</code> is transcluded once but never again, because the wikitext of that call is replaced (substituted) when its page is ''saved''.  What was a one-time template call becomes the actual wikitext of the template at the time of its call.
+
Transclusion events occur every time the page is ''loaded'', when the template is rendered. Another use of the same mechanism is a one-shot ''[[Help:substitution|substitution]]'' of the template call itself by its transcluded source page.  A template call <code><nowiki>{{</nowiki>''[[BTW:page name#Namespace, pagename, and fullpagename|fullpagename]]''}}</code> with the "subst:" prefix <code><nowiki>{{</nowiki>subst:''fullpagename''}}</code> is transcluded once but never again, because the wikitext of that call is replaced (substituted) when its page is ''saved''.  What was a one-time template call becomes the actual wikitext of the template at the time of its call.
  
 
==How transclusion works==
 
==How transclusion works==

Please note that all contributions to BattleTechWiki are considered to be released under the GNU FDL 1.2 (see BattleTechWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Advanced templates:

Editing: {{Merge}}   {{Moratorium}}   {{Otheruses| | | }}

Notices: {{NoEdit}}   {{Sign}}   {{Unsigned|name}}   {{Welcome}}

Administration: {{Essay}}   {{Policy}}   {{Procedure}}

Templates used on this page:

This page is a member of 2 hidden categories: