Content deleted Content added
→Categorization: fixed link |
Zeru birhane (talk | contribs) ←Replaced content with '{{short description|Main technical help page on templates}} {{for|lists of commonly used templates|WP:Template index}} {{For|a quick introduction to templates|Help:A quick guide to templates}} {{Redirect|H:T|help regarding tables|Help:Table}} {{Redirect|Wikipedia:Template|content guidelines|Wikipedia:Template namespace}} {{Pp-semi-indef}} {{Wikipedia how to|H:T|WP:TEMPLATE}} {{Wiki markup}} ==General description== File:Introduction to templates on Wik...' Tags: Replaced Reverted Visual edit |
||
Line 7:
{{Wikipedia how to|H:T|WP:TEMPLATE}}
{{Wiki markup}}
==General description==
[[File:Introduction to templates on Wikipedia.webm|thumb|A basic overview of how templates work (8-minute video)]]
Most templates are in the [[WP:Template namespace|template namespace]], which means that they have titles in the form "Template:{{var|XXXX}}". It is possible, however, to transclude and substitute from any namespace,{{efn|Namespaces from which transclusion is not allowed are specified on a wiki by the variable <code>[[mw:Manual:$wgNonincludableNamespaces|$wgNonincludableNamespaces]]</code>.}} and so some template pages are placed in other namespaces, such as the [[WP:User pages|user namespace]]. Template pages have associated [[Help:Talk pages|talk pages]].
==Using templates==
===General===
Using a template is similar to calling a [[Function (computer programming)|function]] in programming. When called, it returns a value. For a template, calling is known as a ''template call'' and the return value is known as the ''expansion'' of the template, which is treated as part of the calling page's source. Like functions, some templates can take parameters that affect their output.
{{A note}} Attempting to transclude a template that does not exist produces a [[WP:Red link|red link]], just like linking to any other nonexistent page. Following the link allows one to create that particular template. It is not possible to transclude templates between projects (such as different-language Wikipedias or MediaWiki) – to use a template on another language project, a copy of the template must be created in that project.
Line 50 ⟶ 23:
{{Further|Help:Transclusion#Template parameters}}
{{shortcut|H:PARAMETER|WP:PARAMETER}}
==== Whitespace handling ====
==== Variable length parameter lists ====
===Examples===
Line 85 ⟶ 32:
{{A note}} If you wish to experiment with any of these, you can use the [[Template:Template sandbox|template sandbox]] or your user page or sandbox. You can try out your template with [[Special:ExpandTemplates]].
{{Wikipedia technical help}}
|