Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Numinix MediaWiki Demo
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Help/Templates
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
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.
Anti-spam check. Do
not
fill this in!
== Ways to invoke a template == <!--T:262--> <!--T:14--> Templates can be used in other pages in these ways: <!--T:15--> * <code><nowiki></nowiki></code> β As described above, this text (commonly referred to as a "template call") will be ''dynamically'' replaced by the content of the page titled Template:Name (a process called "transclusion") every time the page with the template call is '''loaded''' (i.e., viewed by a reader of the wiki).</translate> <translate><!--T:234--> Because the template call remains in the pages's source, any subsequent change to Template:Name will be seen on the page containing the template call.</translate> <translate><!--T:235--> Also, the page will be listed among those that "link to" the template.</translate> <translate> <!--T:16--> * <code><nowiki></nowiki></code> β When this type of template call is used, it will be replaced by a ''static copy'' of the content of Template:Name as of the time the page containing the template call is '''saved'''.</translate> <translate><!--T:236--> That is, a copy of the contents of Template:Name will be ''substituted'' for the template call.</translate> <translate><!--T:237--> No link is maintained between the page and the template, so each can be edited further without affecting the other.</translate> <translate><!--T:238--> In effect, there is little difference between substituting the content in this way and simply typing it into the page's source "manually".</translate> <translate><!--T:263--> See <tvar name=1></tvar> for more information.</translate> <translate> <!--T:17--> * </nowiki></code></tvar>|Name}} β This was introduced to allow for recursive substitution in cases where templates contain calls to other templates or parser functions.</translate> <translate><!--T:239--> See <tvar name=1></tvar> for more information.</translate> <translate> <!--T:18--> * </nowiki></code></tvar>|Name}} β This displays the template content as raw wiki syntax (the way <tvar name=1></tvar> does) when the page containing it is viewed.</translate> <translate><!--T:264--> For example, <tvar name="1"><code><nowiki></nowiki></code></tvar> displays:</translate> |Template:Thankyou/|Template:Thankyou}}}} <translate> <!--T:19--> In fact, an ordinary wiki page can also be used as a template, simply by specifying the namespace it resides in, so: </translate> * <translate><!--T:20--> <code><nowiki></nowiki></code> transcludes the page titled Template:Pagename (equivalent to <code><nowiki></nowiki></code>)</translate> * <translate><!--T:21--> <code><nowiki></nowiki></code> transcludes the page titled Talk:Pagename</translate> * <translate><!--T:22--> <code><nowiki></nowiki></code> transcludes the page titled Pagename (i.e., in the main namespace)</translate> ** <translate><!--T:23--> <code><nowiki></nowiki></code> substitutes the contents of the page titled Pagename</translate> <translate> <!--T:24--> If the specified namespace doesn't exist, the full title is assumed to be a template: <!--T:25--> * <tvar name=1><code><nowiki></nowiki></code></tvar> transcludes <tvar name=2>Template:Foo:Bar</tvar> </translate> <translate><!--T:265--> Regardless of what syntax is used, the name of the template can be relative to the current page</translate> /$2</code></tvar> is called on page <tvar name="2">$1</tvar>, it will transclude the page <tvar name="3">$1/$2</tvar>.</translate> |1=<translate><!--T:267--> foo</translate> |2=<translate><!--T:268--> bar</translate> }} <translate><!--T:269--> It can also be generated dynamically. </translate> $1 }}</code></tvar> calls <tvar name="2">Template:$1</tvar> and interprets the result as the name of another template to call.</translate> |1=<translate><!--T:271--> foo</translate> }} <translate>
Summary:
Please note that all contributions to Numinix MediaWiki Demo may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)