Help:Templates: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Used dark <pre> style to give headlines a chance to stand out. Undid substitution of {{KV BaseEntity}}. Added and used Template:Expand. Used some Template:tl. Added {{not}} to section Per-Game templates. Other beautifying (or so).)
(Overhaul. Fixed TOC by removing Main Page transclusion. Removed <pre>s in first sections, should be more reader-friendly now. Described /doc-ing. Added suggestions to Per-game Templates. Grouped useful Templates. Named more templates.)
Line 1: Line 1:
{{lang|Help:Templates}}
{{lang|Help:Templates}}
{{toc-right}}
{{back|Help:Editing}}
{{back|Help:Editing}}
Templates enable you to do things much faster and/or easier. Templates are used very frequently on pages, so it's best to learn about them. When the wiki sees a template it recognizes on a page, it will automatically replace it with something else. What appears there is up to the users.
'''Templates''' enable you to do things much faster and/or easier. Templates are used very frequently on pages, so it's best to learn about them. When the wiki sees a template it recognizes on a page, it will automatically replace it with something else. What appears there is up to the users.
<div style="padding:0 1em; background:#303030; border:1px gray solid; display:inline-block">
[[#How to use a template|1&nbsp;&nbsp;How to use a template]]<br>
[[#Making templates|2&nbsp;&nbsp;Making templates]]<br>
[[#Templates not updating|3&nbsp;&nbsp;Templates not updating]]<br>
[[#Template shortcuts|4&nbsp;&nbsp;Template shortcuts]]<br>
[[#Useful templates|5&nbsp;&nbsp;Useful templates]]<br>
[[#Magic words|6&nbsp;&nbsp;Magic words]]<br>
[[#See Also|7&nbsp;&nbsp;See Also]]
</div>


==How to use a template==
==How to use a Template==
Before a template can be added somewhere, first its contents must be defined on its own page. Template pages should start with the prefix <code>Template:</code>.
Before a template can be added somewhere, first its contents must be defined on its own page. Template pages should start with the prefix <code>Template:</code>.


Line 20: Line 10:
To add a template to a page (which is called ''transcluding''), simply type <code>{{</code>, the name of the template, and then <code>}}</code>. If you wish to add any parameters, put a <code>|</code> between the template's name and the <code>}}</code>, and define the parameters there. All parameters you define need to be separated by another <code>|</code>.
To add a template to a page (which is called ''transcluding''), simply type <code>{{</code>, the name of the template, and then <code>}}</code>. If you wish to add any parameters, put a <code>|</code> between the template's name and the <code>}}</code>, and define the parameters there. All parameters you define need to be separated by another <code>|</code>.


{{note|Any page can be transcluded by another one actually. Below is a transclusion of the [[Main Page]] using <code><nowiki>{{Expand|{{:Main Page}}}}</nowiki></code>:}}
{{note|Any page can be transcluded by another one actually. A transclusion of the [[Main Page]] can be done using {{tlc|&#58;Main Page}}, but we don't do this here because it would add all of the headlines of the Main Page to the table of contents of this page.}}
{{Expand|{{:Main Page}}}}


===Examples===
===Examples===
Here's a template where we don't define any parameters, you just drop it right in.
Here's a template where we don't define any parameters, you just drop it right in. If you visit [[Template:Restart]], you'll see that it's just those five words.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{restart}}</pre>
:{{tlc|restart}} &rarr; {{restart}}
Result: {{restart}}


If you visit [[Template:Restart|this template's page]], you'll see that its just those five words.
The [[Template:Ent]] is a template that can accept up to two ''unnamed'' parameters. The order of unnamed parameters matters.
:{{tlc|ent|sv_cheats|1}} &rarr; {{ent|sv_cheats|1}}


[[Template:KV]] is one of the most common templates used. It accepts multiple optional ''named'' parameters such as <code>only</code> and <code>nofgd</code>. Named parameters can be defined in any order.
:{|
| {{tlc|KV|only{{=}}&#123;&#123;css&#125;&#125;|ammo|nofgd{{=}}1|integer|Amount of reserve ammo to be added. Fallback value is 0.}}
|-
| &darr;
|-
| {{KV|only={{css}}|ammo|nofgd=1|integer|Amount of reserve ammo to be added. Fallback value is 0.}}
|}


The [[Template:Ent|ent]] template is a template that can accept up to two ''unnamed'' parameters.
Without the <code>|nofgd=1</code>, the <strong>{{!fgd}}</strong> part would not have displayed.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{ent|sv_cheats|1}}</pre>
{{note|Unnamed parameters can be specified like named parameters in any order, like so: {{tlc|ent|2{{=}}1|1{{=}}sv_cheats}} &rarr; {{ent|2=1|1=sv_cheats}}}}
Result: {{ent|sv_cheats|1}}
{{note|When calling a template, you can always specify any number of named and unnamed parameters. The only question is whether the template regards them or not, yielding a different result or the same. By the way, specifying a parameter multiple times displays an error at the top of the page.}}
 
Unnamed parameters must be defined in a specific order.


Templates can also use templates, named nesting. [[w:Recursion (computer science)|Recursion]] is not supported, so a template cannot use itself.


[[Template:KV|KV]] is one of the most common templates used. It accepts an optional ''named'' parameter (<code>since</code>).
===Substitution===
<pre style="background-color:#444;border-color:#666;color:#ddd">{{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.|since=l4d2}}</pre>
This is for advanced users. Instead of transcluding a template, one can choose to ''substitute'' it. Substitution will replace the wikitext of a template call with the contents ''of'' the template.
Result: {{KV|Script think function (thinkfunction)|string|Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.|since=l4d2}}
Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See [[Wikipedia:Help:Substitution]] for more information.
Without the <code>|since=l4d2</code> at the end, the {{l4d2 add}} message would not have displayed. Named parameters can be defined in any order.


Templates can also use templates (nesting). In the KV template above, the <code>|since=l4d2</code> part [[Template:l4d2 add|adds <code><nowiki>{{l4d2 add}}</nowiki></code>]] into the page, which is the {{l4d2 add}} message.
To substitute a template, transclude it like you normally would, then add <code>subst:</code> between <code>{{</code> and the template's name. After that, click the save button and the wikitext will automatically be added.


===Substitution (for advanced users)===
For example, if you write {{tlc|restart}} on a page, save it, and edit the page again, you will still find {{tlc|restart}} at the same place in the wikitext. In contrast, if you save {{tlc|subst:restart}} and edit the page again, you'll find <code>Requires restart to take effect.</code> instead. It can be imagined that the wiki "copy-pastes" the content over, but it does regard parameter values:
Instead of transcluding a template, one can choose to ''substitute'' it. Substitution will replace a template with the contents ''of'' the template directly onto the page. To substitute a template, transclude it like you normally would, then add <code>subst:</code> between <code>{{</code> and the template's name. After that, click the save button and the wikitext will automatically be added. Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See [[Wikipedia:Help:Substitution]] for more information.
:{{tlc|subst:delete|This is a bad page.}}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{subst:delete|This is a bad page.}}</pre>
If a page is saved with this, that text will be replaced with the content of [[Template:Delete]] where every occurrence of {{param|1}} is replaced with <code>This is a bad page.</code>:
When the page is saved, that text will be replaced with this:
:<code><nowiki>{{Delete-meta|{{#if: This is a bad page. | This is a bad page. }} }}[[Category:Candidates for speedy deletion]]</nowiki></code>
<pre style="background-color:#444;border-color:#666;color:#ddd">{{Delete-meta|{{#if: This is a bad page. | This is a bad page. }} }}[[Category:Candidates for speedy deletion]]</pre>
Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.
Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.
{{tip|When editing, be sure to make use of '''View Changes''' before saving substitutions to see what you're actually doing to the wikitext.}}


==Making templates==
==Making Templates==
Making a template like [[Template:Restart]] is rather easy - just type the text you want, and save it. What about ones with parameters?
Making a template like [[Template:Restart]] is rather easy - just type the text you want, and save it. What about ones with parameters?
{{tip|When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<code><nowiki><!-- --></nowiki></code>) can also be useful.}}
{{tip|When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<code><nowiki><!-- --></nowiki></code>) can also be useful.}}
{{note|Named parameters (such as {{param|title}}) will have leading and trailing whitespace trimmed in the template's result, unnamed parameters (such as {{param|1}}) will not.}}


===Unnamed parameters===
===Unnamed Parameters===
To add an unnamed parameter, simply put <code>{{{1}}}</code> where you want it to be.
To add an unnamed parameter, simply put {{param|1}} where you want the value of the first unnamed parameter that the user might have specified to be inserted.
 
Here's a part of the code for [[Template:Tip]]:
Here's part of the code for [[Template:Tip]]:
:<code>Tip:{{param|1}}</code>
<pre style="background-color:#444;border-color:#666;color:#ddd">Tip:{{{1}}}</pre>
If you've seen this template before you know that it has its own special look, but this is all we will look at for now. All the user has to do when transcluding this is enter the text they want:
If you've seen this template before you know that it has its own special look, but this is all we will look at for now. All the user has to do when transcluding this is enter the text they want:
<pre style="background-color:#444;border-color:#666;color:#ddd">{{tip|Do not carve without vertex editing afterward.}}</pre>
:{|
Result: {{tip|Do not carve without vertex editing afterward.}}
| {{tlc|tip|Do not carve without vertex editing afterward.}}
 
|-
| &darr;
|-
| {{tip|Do not carve without vertex editing afterward.}}
|}
If you want to add more than one unnamed parameter, simply change the number. Here's the old (condensed) code for [[Template:Distinguish]]:
If you want to add more than one unnamed parameter, simply change the number. Here's the old (condensed) code for [[Template:Distinguish]]:
<pre style="background-color:#444;border-color:#666;color:#ddd">:''Not to be confused with [[:{{{1}}}]]{{#if:{{{2|}}} |{{#if:{{{3|}}} |, [[:{{{2}}}]]|&nbsp;or [[:{{{2}}}]].}}|.}}{{#if:{{{3|}}} |{{#if:{{{4|}}} |, [[:{{{3}}}]]|, or [[:{{{3}}}]].}}}}{{#if:{{{4|}}} |, or [[:{{{4}}}]].}}''</pre>
<pre style="background-color:#444;border-color:#666;color:#ddd">:''Not to be confused with [[:{{{1}}}]]{{#if:{{{2|}}} |{{#if:{{{3|}}} |, [[:{{{2}}}]]|&nbsp;or [[:{{{2}}}]].}}|.}}{{#if:{{{3|}}} |{{#if:{{{4|}}} |, [[:{{{3}}}]]|, or [[:{{{3}}}]].}}}}{{#if:{{{4|}}} |, or [[:{{{4}}}]].}}''</pre>
Line 71: Line 69:


All the user has to do when transcluding is this:
All the user has to do when transcluding is this:
<pre style="background-color:#444;border-color:#666;color:#ddd">{{distinguish|Combine|Civil Protection|Overwatch}}</pre>
:{|
Result: {{distinguish|Combine|Civil Protection|Overwatch}}
| {{tlc|distinguish|Combine|Civil Protection|Overwatch}}
|-
| &darr;
|-
| {{distinguish|Combine|Civil Protection|Overwatch}}
|}


===Named parameters===
===Named Parameters===
Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at [[Template:IO]], which has many named parameters. In this template, <code>{{{param}}}</code> marks a place to add wikitext that's defined by <code>|param=texthere</code> when transcluding.
Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at [[Template:IO]], which has many named parameters. In this template, <code>{{{param}}}</code> marks a place to add wikitext that's defined by <code>|param=texthere</code> when transcluding.


With named parameter:
With named parameter:
<pre style="background-color:#444;border-color:#666;color:#ddd">{{IO|SetString|Updates the string.|param=string}}</pre>
:{|
Result: {{IO|SetString|Updates the string.|param=string}}
| {{tlc|IO|SetString|Updates the string.|param{{=}}string}}
 
|-
| &darr;
|-
| {{IO|SetString|Updates the string.|param=string}}
|}


Without named parameter:
Without named parameter:
<pre style="background-color:#444;border-color:#666;color:#ddd">{{IO|SetString|Updates the string.}}</pre>
:{|
Result: {{IO|SetString|Updates the string.}}
| {{tlc|IO|SetString|Updates the string.}}
 
|-
===Default value===
| &darr;
To make a parameter have a value by default, add a <code>|</code> to the right of the parameter name, and then define the value. Named ''and'' unnamed parameters can use this.
|-
<pre style="background-color:#444;border-color:#666;color:#ddd">{{{1|3000}}}</pre>
| {{IO|SetString|Updates the string.}}
This would make the value for <code>1</code> {{{1|3000}}}.
|}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{{value|}}}</pre>
===Default Value===
This returns nothing. Without the <code>|</code>, it would literally return "{{{value}}}" as text, if it hasn't already been defined at some other point.
To make a parameter have a value by default, add a <code>|</code> to the right of the parameter name, and then define the value. Both named ''and'' unnamed parameters can use this.
:{{param|1|3000}}
This would set the value for <code>1</code> to {{{1|3000}}} if the user does not specify it.
:{{param|value|}}
This returns nothing. Without the <code>|</code>, it would literally return <code>{{{value}}}</code> as text, if it hasn't already been defined at some other point.


===Parser Functions===
===Parser Functions===
<code>#if:</code> checks if a string or parameter has anything inside it.
To make text (dis)appear only if a certain parameter is defined or set to a specific value, the following expressions must be used.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}</pre>
Result: {{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }} ''(The parameter <code><nowiki>{{{target|}}}</nowiki></code> returns null because you (probably) are not viewing this page through a transclusion, so it's never had a chance to be defined.)''
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#if: Something is there! | Target aqcuired | Sleep mode activated... }}</pre>
Result: {{#if: Something is there! | Target aqcuired | Sleep mode activated... }}


<code>#if:</code> checks if a string is empty or not. The syntax is <code><nowiki>{{#if: <string> | <then> | <else> }}</nowiki></code>. This expression evaluates to <code><then></code> iff <code><string></code> is the empty string, otherwise to <code><else></code>. The <code><else></code> value can be omitted in which case it defaults to the empty string; The same applies to the following <code><else></code>s.
:<code><nowiki>{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}</nowiki></code> &rarr; {{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }}
:<code><nowiki>{{#if: Something is there! | Target aqcuired | Sleep mode activated... }}</nowiki></code> &rarr; {{#if: Something is there! | Target aqcuired | Sleep mode activated... }}
{{note|''The expression <code><nowiki>{{{target|}}}</nowiki></code> returns the empty string because you (probably) are not viewing this page through a transclusion, so it's never had a chance to be defined.''}}


<code>#ifeq:</code> checks for equality between two strings. It can be used with parameters as well.
<code>#ifeq:</code> checks for equality between two strings. The syntax is <code><nowiki>{{#ifeq: <string1> | <string2> | <then> | <else> }}</nowiki></code>. This evaluates to <code><then></code> iff the two (trimmed) strings are entirely equal, otherwise to <code><else></code>.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#ifeq: {{{target|}}} | friend | Friend... | Go away! }}</pre>
:<code><nowiki>{{#ifeq: {{{target|}}} | friend | Friend... | Go away! }}</nowiki></code> &rarr; {{#ifeq: {{{target|}}} | friend | Friend... | Go away! }}
Result: {{#ifeq: {{{target|}}} | friend | Friend... | Go away! }}
:<code><nowiki>{{#ifeq: friend | friend | Friend... | Go away! }}</nowiki></code> &rarr; {{#ifeq: friend | friend | Friend... | Go away! }}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#ifeq: friend | friend | Friend... | Go away! }}</pre>
Result: {{#ifeq: friend | friend | Friend... | Go away! }}


<code>#switch:</code> checks for equality between an input string and ''multiple'' strings. The syntax is
<code><nowiki>{{#switch: <input> | <string1> = <value1> | <string2> = <value2> | ... | #default = <default> }}</nowiki></code>.
This statement evaluates to the corresponsing value of the first <code><stringX></code> that equals the <code><input></code>. If that value is empty, then the value of the next non-empty string is used instead. If no equality is found, <code><default></code> is returned which defaults to the empty string if not specified.


<code>#expr:</code> solves math problems.
<code>#expr:</code> solves math problems. See [[m:Help:Calculation|Help:Calculation]] for all it's abilities.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#expr: 2 + 2}}</pre>
:<code><nowiki>{{#expr: 2 + 2}}</nowiki></code> &rarr; {{#expr: 2 + 2}}
Result: {{#expr: 2 + 2}}
:<code><nowiki>{{#expr: cos(0)^2}}</nowiki></code> &rarr; {{#expr: cos(0)^2}}


See [[m:Help:Calculation]] for all it's abilities.
<code>#ifexpr:</code> tests whether a math expression is true or false and can returns different values depending on it.
 
:<code><nowiki>{{#ifexpr: 6 + 3 = 9 | Right | Wrong }}</nowiki></code> &rarr; {{#ifexpr: 6 + 3 = 9 | Right | Wrong }}
 
:<code><nowiki>{{#ifexpr: 6 + 3 = 23 | Right | Wrong }}</nowiki></code> &rarr; {{#ifexpr: 6 + 3 = 23 | Right | Wrong }}
<code>#ifexpr:</code> tells if a math expression is correct.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#ifexpr: 6 + 3 = 9 | Right | Wrong }}</pre>
Result: {{#ifexpr: 6 + 3 = 9 | Right | Wrong }}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{#ifexpr: 6 + 3 = 23 | Right | Wrong }}</pre>
Result: {{#ifexpr: 6 + 3 = 23 | Right | Wrong }}


===Documentation===
===Documentation===
Please give a description of what your template is, and maybe examples. To keep this describing text from appearing on pages that use the template, there are 3 different HTML tags you can use.
Please give a description of what your template does, and especially examples. To keep this describing text from appearing on pages that use the template, there are three different HTML tags you can use.
* <code><nowiki><noinclude>...</noinclude></nowiki></code> makes wikitext inside it not appear on the destination page, while keeping it on the template's page.
* <code>&lt;noinclude>...&lt;/noinclude></code> makes wikitext inside it not appear on the destination page, while keeping it on the template's page.
* <code><nowiki><onlyinclude>...</onlyinclude></nowiki></code> makes only wikitext inside it appear on destination pages. Text not inside these will still appear on the template's page.
* <code>&lt;onlyinclude>...&lt;/onlyinclude></code> makes only wikitext inside it appear on destination pages. Text not inside these will still appear on the template's page.
* <code><nowiki><includeonly>...</includeonly></nowiki></code> makes wikitext inside it not appear on the template page. It has no effect on the destination page.
* <code>&lt;includeonly>...&lt;/includeonly></code> makes wikitext inside it not appear on the template page. It has no effect on the destination page.


They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.
They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.


==Templates not updating==
If the documentation cannot be kept short, then it is a good idea to move all explanations and/or examples to an own page. By convention, the documentation page of a template should be its subpage <code>/doc</code>. For instance, [[Template:Note]] has its documentation page [[Template:Note/doc]]. When created, the documentation is transcluded to the template page using just the expression {{tl2|documentation}} which of course must be excluded using the above three tags.
If you've recently edited a template and the changes are not applying on pages it's been transcluded to, add <code>?action=purge</code> at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes.


==Template shortcuts==
Sometimes, templates are used identically. As you might know, [[Template:Tip]] and Template:Note both use their one parameter in exactly the same manner, so there is no need for another page with an identical documentation for Tip. Tip can use the same documentation as Note using the expression {{tlc|documentation|Template:Note/doc}}; The only magic behind this is that Template:Note/doc uses the expression {{tlc|ROOTPAGENAME}} instead of <code>Note</code> for its examples so that the examples adapt to the page that they are displayed on. If Template:Note/doc wasn't made for this, this wouldn't work out.
Some templates may have template shortcuts, which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.
Other "generic docs" like this that are in use are [[Template:Hl2]] and [[Template:Yes]].


==Useful templates==
===Templates not updating===
All templates in '''{{style|color:#8BC53F|green text}}''' are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into [[:Category:TODO]].
If you've recently edited a template and the changes are not applying on pages that it's been transcluded to, add <code>?action=purge</code> at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes.
If you're on a template page with a documentation, you can also use the "[purge]" button for the same effect.


===Per-game templates===
===Template Shortcuts===
All games have templates that show their associated icon, e.g. <code><nowiki>{{hl2}}</nowiki></code> delivers: {{hl2}}. See [[:Category:Game icons]] or {{tl|game icon name}} for the full list.
Some templates may have template [[Template:shortcut|shortcuts]], which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.
* {{tl|Game link}} automatically links to a game's page and displays its icon next to it, e.g. <code><nowiki>{{Game link|Half-Life 2}}</nowiki></code> delivers: {{Game link|Half-Life 2}}.
* {{tl|Game name}} does the same but is more colorful and needs another parameter, e.g. <code><nowiki>{{Game name|hl2|name=Half-Life 2}}</nowiki></code> delivers: {{Game name|hl2|name=Half-Life 2}}.
* {{tl|since}} can be used to quickly note features that were added in a game and are available in all Source games afterwards, e.g. <code><nowiki>{{since|{{portal2}}}}</nowiki></code> delivers: {{since|{{portal2}}}}.
* {{tl|only}} indicates features that are exclusive to a specific game, e.g. <code><nowiki>{{only|{{csgo}}}}</nowiki></code> delivers: {{only|{{csgo}}}}.
* {{tl|also}} notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template, e.g. {{only|{{L4d}}}} {{also|{{GMOD}}}} or {{since|{{as}}}} {{also|{{GMOD}}}}.
* {{tl|removed}} indicates that a feature was removed in a game and all later engine branches, e.g. <code><nowiki>{{removed|{{L4d}}}}</nowiki></code> delivers: {{removed|{{L4d}}}}.
* {{tl|not}} indicates that a feature might be in other games but not in a specific one, e.g. <code><nowiki>{{not|{{czds}}}}</nowiki></code> delivers: {{not|{{czds}}}}.


=== = ===
[[Template:=]] is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. An equal sign generated through this will never be counted as formatting.


===bug===
==Useful Templates==
[[Template:Bug]] notifies readers of a [[Wikipedia:Software bug|bug]].
<pre style="background-color:#444;border-color:#666;color:#ddd">{{bug|The amount is double what it should be. Be careful!}}</pre>
Result: {{bug|The amount is double what it should be. Be careful!}}


===clarify===
All templates in '''{{style|color:#8BC53F|green text}}''' are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into [[:Category:TODO]].
[[Template:Clarify]] marks things that should be clarified.
<pre style="background-color:#444;border-color:#666;color:#ddd">PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}</pre>
Result: PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}
 
===cleanup===
[[Template:Cleanup]] marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{cleanup|The last section needs to be clarified.}}</pre>
Result: {{messagebox
|text = This article needs to be '''cleaned up''' to conform to a higher standard of quality because:''' <p style="font-style: italic;">The last section needs to be clarified.</p>
|small = For help, see the [[Help:Editing|VDC Editing Help]] and [[Wikipedia:Wikipedia:Cleanup_process#Advice_on_fixing_articles|Wikipedia cleanup process]]. Also, remember to check for any notes left by the tagger at this article's [[{{TALKPAGENAME}}|talk page]].
|image = [[File:broom_icon.png|40px|link=]]
|bdcolor = #F4C430
}}
 
===clr===
[[Template:Clr]] clears the vertical space to the left and right of floating tables, floating images etc. To clear only the left or only the right side, use <code><nowiki>{{clr|left}}</nowiki></code> or <code><nowiki>{{clr|right}}</nowiki></code>. This is commonly used for making headlines not get moved around by images.
{| class=wikitable width=100%
|
[[File:Skull and crossbones.png|50px|frameless|left]]
This text should appear next to the image. If you put <code><nowiki>{{clr}}</nowiki></code> right after this,


this bit of text here will get moved down right under the image.
===Per-game Templates===
|
[[File:Skull and crossbones.png|50px|frameless|left]]
This text should appear next to the image. If you put <code><nowiki>{{clr}}</nowiki></code> right after this,{{clr}}


this bit of text here will get moved down right under the image.
All games have templates named by their shortcut that can deliver their associated icon and/or a link to their page. See [[:Category:Game icons]] for a full list of game shortcuts. All of them accept the same set of parameters that are described on every template page. The following table should give examples and also give ideas on when to use them.
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
! Wikitext
!colspan=3| Example
! Description
! Formerly used template
|-
| {{tlc|<shortcut>}} || {{tl2|hl2}}||&rarr;||{{hl2}} || Displays the game's icon which links to its game's page and shows the game's name as a hover text. Putting this at the beginning (or end) of a word or line is the shortest and most common way of clarifying that something applies only to a specific game, but there are more ways. ||
|-
| {{tlc|<shortcut>|2}} || {{tlc|hl2|2}}||&rarr;||{{hl2|2}} || Displays the game's icon followed by its name which both link to the game's page. Useful in sentences when the icon alone is too little but the next style is too much. || {{tl2|game link}}
|-
| {{tlc|<shortcut>|4}} || {{tlc|hl2|4}}||&rarr;||{{hl2|4}} || Does the same but using colorful text which grabs more attention, so don't overuse this on a page. Especially if you name the same game multiple times in a text, you definitely don't need a long, colorful link every time, let alone a link. || {{tl2|game name}}
|-
| {{tlc|<shortcut>|in}} || {{tlc|hl2|in}} ||&rarr;|| {{hl2|in}} || Can be used to indicate that something applies to a specific game. Useful at the end of a line or key word; The same applies to the following variants. || {{tl2|in}}
|-
| {{tlc|<shortcut>|since}} || {{tlc|portal2|since}} ||&rarr;|| {{portal2|since}} || Can be used to quickly note features that were added in a game and are available in all Source games afterwards. || {{tl2|since}}
|-
| {{tlc|<shortcut>|only}} || {{tlc|csgo|only}} ||&rarr;|| {{csgo|only}} || Indicates features that are exclusive to a specific game. || {{tl2|only}}
|-
| {{tlc|<shortcut>|also}} || {{tlc|as|since}}&nbsp;{{tlc|gmod|also}} ||&rarr;|| {{as|since}}&nbsp;{{gmod|also}} || Notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template. || {{tl2|also}}
|-
| {{tlc|<shortcut>|removed}} || {{tlc|l4d|removed}} ||&rarr;|| {{l4d|removed}} || Indicates that a feature was removed in a game and all later engine branches. || {{tl2|removed}}
|-
| {{tlc|<shortcut>|not}} || {{tlc|czds|not}} ||&rarr;|| {{czds|not}} || Indicates that a feature might be in other games but not in a specific one. || {{tl2|not}}
|}
|}




===confirm===
[[Template:Confirm]] marks something that needs to be confirmed. It's green color is meant to stand out.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{confirm|Always goes to the left.}}</pre>
Result: {{#if: Always goes to the left. | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">Always goes to the left.</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}
<pre style="background-color:#444;border-color:#666;color:#ddd">Always goes to the left.{{confirm}}</pre>
Result: Always goes to the left.{{#if:  | <div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">{{{1}}}</span></div> | <sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup> }}


===delete===
=== Inline Note Templates ===
[[Template:Delete]] marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{delete|This is not a real thing.}}</pre>
Result: {{messagebox
|text = '''This page is a [[Help:Deletion|candidate for speedy deletion]]{{#if: {{#if: This is not a real thing. | This is not a real thing. }}  | &nbsp;because:''' <p style="font-style: italic;">{{#if: This is not a real thing. | This is not a real thing. }} </p>| .''' }}


If you disagree with its speedy deletion, please explain why on [[{{NAMESPACE}} talk:{{PAGENAME}}|its talk page]]. If this page obviously does not meet the criteria for speedy deletion, or you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
The following are some of the [[:Category:inline note templates|inline note templates]].
|small =
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
''Administrators - Remember to check [[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|if anything links here]] and [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} the page history] ([{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|diff=0}} last edit]) before [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=delete}} deleting].''
! Description
|image = [[File:Warning_icon.png|40px|link=]]
! Wikitext and Result
|bdcolor = #B22222
|-
}}
| [[Template:Bug]] notifies readers of a [[Wikipedia:Software bug|bug]].
| {{tlc|bug|The amount is double what it should be. Be careful!}}<br>{{bug|The amount is double what it should be. Be careful!}}
|-
| [[Template:Clarify]] marks things that should be clarified.
| <code>PAS is a kind of bounding-box for Player or NPC AI sound detection.{{tlc|clarify}}</code><br>PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}
|-
|rowspan=2| [[Template:Confirm]] marks something that needs to be confirmed. It's green color is meant to stand out.
| {{tlc|confirm|Always goes to the left.}}<br><div style="margin:0.4em 1em 0.5em;"><strong style="color:#8BC53F;display:table-cell;text-align:right;white-space:nowrap;padding-right:0.3em;">[[File:Confirm.png|link=|alt=]] Confirm:</strong><span style="display:table-cell;">Always goes to the left.</span></div>
|-
|<code>Always goes to the left.{{tlc|confirm}}</code><br>Always goes to the left.<sup style="color:#8BC53F;">&#91;''confirm''&#93;</sup>
|-
| [[Template:Distinguish]] lets you notify users about pages that share similar names or may be confused for something else.
| {{tlc|distinguish|"Follow Freeman!"|desc1{{=}}The HL2 chapter}}<br>{{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}
|-
| [[Template:How]] asks the question ''how?''
| <code>Players can get past these.{{tlc|how}}</code><br>Players can get past these.{{how}}
|-
| [[Template:Idea]] is a nifty way to suggest ideas.
| {{tlc|idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}<br>{{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
|-
| [[Template:Note]] is for making notes stand out more.
| {{tlc|note|This will spawn at the map origin if you do not specify the position.}}<br>{{note|This will spawn at the map origin if you do not specify the position.}}
|-
| [[Template:Tip]] marks text as a tip to readers.
| {{tlc|tip|This is a much less tricky process when using the vertex edit tool as well.}}<br>{{tip|This is a much less tricky process when using the vertex edit tool as well.}}
|-
| [[Template:Todo]] marks things that need to be done. It's green color is meant to stand out.
| {{tlc|todo|Find where this is in the game files.}}<br><strong style="color:#8BC53F;white-space:nowrap;">To do&#58;&nbsp;</strong>Find where this is in the game files.
|-
| [[Template:Warning]] marks things that readers should take caution of when doing something.
| {{tlc|warning|This tool has been known to corrupt files. Try an alternative listed below.}}<br>{{warning|This tool has been known to corrupt files. Try an alternative listed below.}}
|-
| [[Template:Why]] asks the question ''why?''
| <code>This shader has been deprecated.{{tlc|why}}</code><br>This shader has been deprecated.{{why}}
|}


===distinguish===
[[Template:Distinguish]] lets you notify users about pages that share similar names or may be confused for something else.


Example from [[Follow Freeman]]:
<pre style="background-color:#444;border-color:#666;color:#ddd">{{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}</pre>
Result: {{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}


===ent===
=== Notice Templates ===
[[Template:Ent]] is a really small template for making text that's both code and a link.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{ent|noclip}}</pre>
Result: {{ent|noclip}}


===Expand/ExpandBox===
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
[[Template:Expand]] or [[Template:ExpandBox]] allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long.
! Description
<pre style="background-color:#444;border-color:#666;color:#ddd">{{Expand|{{KV BaseEntity|noscroll=1}}}}</pre>
!width=70%| Wikitext and Result
Result: {{Expand|{{KV BaseEntity|noscroll=1}}}} <!-- doesn't inherit Categories, no need to subst: -->
<pre style="background-color:#444;border-color:#666;color:#ddd">{{ExpandBox|{{KV BaseEntity|noscroll=1}}}}</pre>
Result: {{ExpandBox|{{KV BaseEntity|noscroll=1}}}}


===how===
|-
[[Template:How]] asks the question ''how?''
| [[Template:Cleanup]] marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else.
<pre style="background-color:#444;border-color:#666;color:#ddd">Players can get past these.{{how}}</pre>
| {{tlc|cleanup|The last section needs to be clarified.}}<br>{{messagebox
Result: Players can get past these.{{how}}
|text = This article needs to be '''cleaned up''' to conform to a higher standard of quality because:''' <p style="font-style: italic;">The last section needs to be clarified.</p>
|small = For help, see the [[Help:Editing|VDC Editing Help]] and [[Wikipedia:Wikipedia:Cleanup_process#Advice_on_fixing_articles|Wikipedia cleanup process]]. Also, remember to check for any notes left by the tagger at this article's [[{{TALKPAGENAME}}|talk page]].
|image = [[File:broom_icon.png|40px|link=]]
|bdcolor = #F4C430
}}


===idea===
|-
[[Template:Idea]] is a nifty way to suggest ideas.
| [[Template:Delete]] marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}</pre>
| {{tlc|delete|This is not a real thing.}}<br>{{messagebox
Result: {{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
|text = '''This page is a [[Help:Deletion|candidate for speedy deletion]]&nbsp;because:''' <p style="font-style: italic;">This is not a real thing. </p>| .'''


===merge===
If you disagree with its speedy deletion, please explain why on [[{{NAMESPACE}} talk:{{PAGENAME}}|its talk page]].  If this page obviously does not meet the criteria for speedy deletion, or you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
[[Template:Merge]] is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done.
|small =
<pre style="background-color:#444;border-color:#666;color:#ddd">{{merge|HDR}}</pre>
''Administrators - Remember to check [[Special:Whatlinkshere/{{NAMESPACE}}:{{PAGENAME}}|if anything links here]] and [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} the page history] ([{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|diff=0}} last edit]) before [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=delete}} deleting].''
Result: {{messagebox
|image = [[File:Warning_icon.png|40px|link=]]
|text = It has been suggested that this article or section be [[Wikipedia:Merging and moving pages|merged]] with ''[[HDR]]''. ([[talk:HDR|Discuss]])
|bdcolor = #B22222
|image = [[File:Merge-arrows.png|50px|link=]]
}}
|bdcolor = #9932CC
}}
 
===messagebox===
[[Template:Messagebox]] provides a standard message box. This template is used by many notice templates, such as merge and cleanup.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{messagebox|text=Remember to follow wiki etiquette.}}</pre>
Result: {{messagebox|text=Remember to follow wiki etiquette.}}
 
===morescreenshots===
[[Template:Morescreenshots]] marks pages that should have more images on them. It allows for an optional text message to clarify what needs images.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{morescreenshots|$envmapcontrast, $envmapsaturation}}</pre>
Result: {{messagebox
|text = This article or section needs additional screenshots for:'''<p style="font-style: italic;">$envmapcontrast, $envmapsaturation</p>| .
|small = You can upload screenshots at [[Special:Upload]]. For help, see the [[Help:Images]].
|image = [[File:Nuvola apps ksnapshot.png|50px|link=]]
|bdcolor = #F4C430
}}


===note===
|-
[[Template:Note]] is for making notes stand out more.
| [[Template:Merge]] is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done.
{{bug|Appears to not accept HTML tags inside it...?}}
| {{tlc|merge|HDR}}<br>{{messagebox
<pre style="background-color:#444;border-color:#666;color:#ddd">{{note|This will spawn at the map origin if you do not specify the position.}}</pre>
|text = It has been suggested that this article or section be [[Wikipedia:Merging and moving pages|merged]] with ''[[HDR]]''. ([[talk:HDR|Discuss]])
Result: {{note|This will spawn at the map origin if you do not specify the position.}}
|image = [[File:Merge-arrows.png|50px|link=]]
|bdcolor = #9932CC
}}


===obsolete===
|-
[[Template:Obsolete]] marks things that should no longer be used. Accepts three parameters, entity, tool, and shader.
| [[Template:Messagebox]] provides a standard message box. This template is used by many notice templates, such as merge and cleanup.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{obsolete|entity=1}}</pre>
| {{tlc|messagebox|text{{=}}Remember to follow wiki etiquette.}}<br>{{messagebox|text=Remember to follow wiki etiquette.}}
Result: {{messagebox
|text = This entity is '''obsolete'''; its use is discouraged and it may only exist/function in older engine branches.
|image = [[File:obsolete.png|40px|link=]]
|bdcolor = #F4C430
}}


===otherlang2===
|-
[[Template:Otherlang2]] is used for linking to versions of pages in other languages. For an example of its use, see the [[Main Page]].
| [[Template:Morescreenshots]] marks pages that should have more images on them. It allows for an optional text message to clarify what needs images.
{{note|It is preferrable to use [[Template:Lang]] instead, because it automatically recognizes every translation for a page, so long as [[Valve Developer Community:Alternative_Languages#Titles|the page name conforms to a standard naming scheme]].}}
| {{tlc|morescreenshots|$envmapcontrast, $envmapsaturation}}<br>{{messagebox
|text = This article or section needs additional screenshots for:'''<p style="font-style: italic;">$envmapcontrast, $envmapsaturation</p>| .
|small = You can upload screenshots at [[Special:Upload]]. For help, see the [[Help:Images]].  
|image = [[File:Nuvola apps ksnapshot.png|50px|link=]]
|bdcolor = #F4C430
}}


===shortcut===
|-
[[Template:Shortcut]] displays a small box noting (abbreviated) redirects to a page.
| [[Template:Obsolete]] marks things that should no longer be used. Accepts three parameters, entity, tool, and shader.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{shortcut|VDC:AL}}</pre>
| {{tlc|obsolete|entity{{=}}1}}<br>{{messagebox
Result: {{shortcut|VDC:AL}}
|text = This entity is '''obsolete'''; its use is discouraged and it may only exist/function in older engine branches.
|image = [[File:obsolete.png|40px|link=]]
|bdcolor = #F4C430
}}


===spammer===
|-
[[Template:Spammer]] marks users that should be banned for spamming. {{bug|This template's formatting may look weird sometimes. It's intended to be the only thing on a page.}}
| [[Template:Spammer]] marks users that should be banned for spamming. For suspicious but not bannable behavior, there is also [[Template:Minor Spammer]]. {{bug|This template's formatting may look weird sometimes. It's intended to be the only thing on a page.}}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{spammer}}</pre>
| {{tlc|spammer}}<br>[[File:Spammer.jpg|left]]
Result: [[File:Spammer.jpg|left]]
<div style="overflow:auto;">
<div style="overflow:auto;">
{{Note|''This user is a [[Wikipedia:Spammer|spammer]], [[Wikipedia:Vandalism|vandal]] or other problem poster and should be considered for a [[Special:Ipblocklist|ban]]''}}
{{Note|''This user is a [[Wikipedia:Spammer|spammer]], [[Wikipedia:Vandalism|vandal]] or other problem poster and should be considered for a [[Special:Ipblocklist|ban]]''}}
Line 296: Line 295:
</div>
</div>


===split-apart===
|-
[[Template:Split-apart]] marks pages that should be split into multiple pages. All splits should be discussed before being done.
| [[Template:Split-apart]] marks pages that should be split into multiple pages. All splits should be discussed before being done.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{split-apart}}</pre>
| {{tlc|split-apart}}<br>{{messagebox
Result:
|text = It has been suggested that this article or section be [[Wikipedia:Wikipedia:Splitting|split]] into multiple articles. ([[:{{NAMESPACE}} talk:{{PAGENAME}}|Discuss]])
{{messagebox
|image = [[File:Split-arrows.png|60px|link=]]
|text = It has been suggested that this article or section be [[Wikipedia:Wikipedia:Splitting|split]] into multiple articles. ([[:{{NAMESPACE}} talk:{{PAGENAME}}|Discuss]])
|bdcolor = #9932CC
|image = [[File:Split-arrows.png|60px|link=]]
}}
|bdcolor = #9932CC
 
|-
| [[Template:Stub]] marks pages that are very small. See [[Help:Stubs]] for info on using.
| {{tlc|stub}}<br>{{messagebox
|text = This article is a [[Help:Stubs|stub]]. You can help by adding to it.
|image = None
}}
 
|-
| [[Template:Translate]] marks pages where translation is needed and adds the page to a category. This template exists in multiple languages, so for a German page, don't add {{tlc|translate}} but instead {{tlc|translate:de}}.
| {{tlc|translate}}<br>{{messagebox|text='''This page needs to be translated.'''
This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
 
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
 
Also, please make sure the article tries to comply with the [[Valve Developer Community:Alternative Languages|alternate languages guide]].
|image = [[File:Info_content.png|40px|link=]]
|bdcolor= #F28500
}}
 
|-
| [[Template:Update]] marks outdated pages.
| {{tlc|update}}<br>{{messagebox
|text = This article needs to be '''updated''' to include current information regarding the subject.
|image = [[File:broom_icon.png|40px]]
}}
 
|-
| [[Template:Wip]] marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime.
| {{tlc|WIP|<nowiki>~~~</nowiki>}}<br>{{messagebox
|text =
'''This article is actively undergoing a [[Wikipedia:Wikipedia:Edit_lock|major edit]].'''<br /> As a courtesy, please do not edit this article while this message is displayed. If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce [[Wikipedia:Help:Edit_conflict|edit conflicts]]; please remove it between editing sessions to allow others to edit the page.
 
{{ #if: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The user who added this notice, should you wish to contact them, is: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The person who added this notice will be listed in its [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} edit history] should you wish to contact them. }}
|image = [[File:Under construction.png|55px]]
|bdcolor = #FF7700
}}
}}


|}
===Miscellaneous Templates===


===stub===
These templates have the purpose of helping the editor.
[[Template:Stub]] marks pages that are very small. See [[Help:Stubs]] for info on using.
{| class="wikitable mw-collapsible" width=100% style=background-color:transparent
<pre style="background-color:#444;border-color:#666;color:#ddd">{{stub}}</pre>
! Description
Result: {{messagebox
!style=width:60%| Wikitext and Result
|text = This article is a [[Help:Stubs|stub]]. You can help by adding to it.
|-
|image = None
|rowspan=2| [[Template:=]] is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. Especially, the equals sign is a special character in template calls, so if an equals sign should be passed as a parameter value, then {{tlc|{{=}}}} is needed for "escaping". For the same purpose, there is also [[Template:!]] for a pipe, [[Template:(((]] for curly brackets and many more, see [[:Category:Templates for within templates]].
}}
| {{tlc|{{=}}}}<br>{{=}}
|-
| {{tlc|note|If x &#123;&#123;{{=}}&#125;&#125; 0, you lose.}}<br>{{note|If x {{=}} 0, you lose.}}


===tip===
|-
[[Template:Tip]] marks text as a tip to readers.
| [[Template:Clr]] clears the vertical space to the left and right of floating tables, floating images etc. To clear only one side, use {{tlc|clr|left}} or {{tlc|clr|right}}. This is commonly used before headlines to push them down so that they don't appear next to an image. In the example on the right, one could also use {{tlc|clr|left}} for the same effect.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{tip|This is a much less tricky process when using the vertex edit tool as well.}}</pre>
| <code><nowiki>[[File:Skull and crossbones.png|50px|left]]
Result: {{tip|This is a much less tricky process when using the vertex edit tool as well.}}
This text is next to the image.{{clr}}This text is below the image.</nowiki></code><br><br>
[[File:Skull and crossbones.png|50px|left]]
This text is next to the image.{{clr}}This text is below the image.


===toc-right===
|-
[[Template:toc-right]] shifts the [[Help:Table of Contents|table of contents]] over to the right side of a page. For an example, see [[Half-Life 2 map reference]].
| [[Template:Ent]] is a really small template for making text that's both code and a link.
| {{tlc|ent|noclip}}<br>{{ent|noclip}}


===todo===
|-
[[Template:Todo]] marks things that need to be done. It's green color is meant to stand out.
|rowspan=2| [[Template:Expand]] or [[Template:ExpandBox]] allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{todo|Find where this is in the game files.}}</pre>
| {{tlc|Expand|{{tlc|KV BaseEntity|noscroll{{=}}1}}}}<br>{{Expand|{{KV BaseEntity|noscroll=1}}}} <!-- doesn't inherit Categories, no need to subst: -->
Result: <strong style="color:#8BC53F;white-space:nowrap;">To do{{#if: Find where this is in the game files. | &#58;&nbsp; }}</strong>Find where this is in the game files.


===unsigned===
|-
[[Template:Unsigned]] is for [[Help:Etiquette|talk pages]]. It should be added at the ends of unsigned comments.
| {{tlc|ExpandBox|{{tlc|KV BaseEntity|noscroll{{=}}1}}}}<br>{{ExpandBox|{{KV BaseEntity|noscroll=1}}}}
<pre style="background-color:#444;border-color:#666;color:#ddd">{{unsigned|JeffLane}}</pre>
Result: {{unsigned|JeffLane}}


===update===
|-
[[Template:Update]] marks outdated pages.
| [[Template:Lang]] stands for '''lang'''uage. This page itself uses the lang template, using the wikitext {{tlc|lang|{{FULLPAGENAME}}}}. The lang template creates flags at the top right corner of a page such as {{en}} {{ru}} {{zh-cn}} and thus must be the first template to be transcluded to be in the right position.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{update}}</pre>
Result:
{{messagebox
|text = This article needs to be '''updated''' to include current information regarding the subject.
|image = [[File:broom_icon.png|40px]]
}}


===warning===
Every page can and should use this template as it lets the reader know of the existence of (correctly titled) [[Valve Developer Community:Alternative Languages|language pages]] of the current page and clicking on the flags links to them. Read more on [[Template:lang]].
[[Template:Warning]] marks things that readers should take caution of when doing something.
| {{tlc|lang|Help:Templates}}<br>''The result is at the very top of this page.''
<pre style="background-color:#444;border-color:#666;color:#ddd">{{warning|This tool has been known to corrupt files. Try an alternative listed below.}}</pre>
Result: {{warning|This tool has been known to corrupt files. Try an alternative listed below.}}


===why===
|-
[[Template:Why]] asks the question ''why?''
| [[Template:Param]] displays the values like parameters in the way that they are used in templates. Useful for template documentations.
<pre style="background-color:#444;border-color:#666;color:#ddd">This shader has been deprecated.{{why}}</pre>
| {{tlc|param|color|#fff}}<br>{{param|color|#fff}}
Result: This shader has been deprecated.{{why}}


===wip===
|-
[[Template:Wip]] marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime.
| [[Template:Shortcut]] displays a small box noting (abbreviated) redirects to a page.
<pre style="background-color:#444;border-color:#666;color:#ddd">{{WIP|~~~}}</pre>
| {{tlc|shortcut|VDC:AL}}<br>{{shortcut|VDC:AL}}
Result:
{{messagebox
|text =
'''This article is actively undergoing a [[Wikipedia:Wikipedia:Edit_lock|major edit]].'''<br /> As a courtesy, please do not edit this article while this message is displayed. If this page has not been edited for at least several hours to a few days, please remove this template. This message is intended to help reduce [[Wikipedia:Help:Edit_conflict|edit conflicts]]; please remove it between editing sessions to allow others to edit the page.


{{ #if: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The user who added this notice, should you wish to contact them, is: [[User:Pinsplash|Pinsplash]] ([[User talk:Pinsplash|talk]]) | The person who added this notice will be listed in its [{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=history}} edit history] should you wish to contact them. }}
|-
|image = [[File:Under construction.png|55px]]
| [[Template:Tl]] stands for '''T'''emplate '''L'''ink. It creates a link to a template surrounded by &#123;&#123; &#125;&#125;.
|bdcolor = #FF7700
| {{tlc|tl|note}}<br>{{tl|note}}
|-
| [[Template:Tl2]] does the same but using &lt;code> formatting. It also accepts parameters that act like parameters for the template that is linked to.
| {{tlc|tl2|note|Example}}<br>{{tl2|note|Example}}
|-
| [[Template:Tlc]] does the same but not creating a link, which is useful when trying to display template examples (like this entire page!).
| {{tlc|tlc|note|Example}}<br>{{tlc|note|Example}}
|-
| [[Template:Toc-right]] shifts the [[Help:Table of Contents|table of contents]] over to the right side of a page.
| For an example, see [[Half-Life 2 map reference]].


}}
|-
| [[Template:Unsigned]] is for [[Help:Etiquette|talk pages]]. It should be added at the ends of unsigned comments.
| {{tlc|unsigned|JeffLane}}<br>{{unsigned|JeffLane}}
|}


==Magic words==
==Magic Words==
Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.
Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.



Revision as of 18:36, 21 May 2022

English (en)Русский (ru)中文 (zh)Translate (Translate)
Help:Editing

Templates enable you to do things much faster and/or easier. Templates are used very frequently on pages, so it's best to learn about them. When the wiki sees a template it recognizes on a page, it will automatically replace it with something else. What appears there is up to the users.

How to use a Template

Before a template can be added somewhere, first its contents must be defined on its own page. Template pages should start with the prefix Template:.

Templates have some limited programming abilities, which gives them lots of possibilities. We'll talk more about those later.

To add a template to a page (which is called transcluding), simply type {{, the name of the template, and then }}. If you wish to add any parameters, put a | between the template's name and the }}, and define the parameters there. All parameters you define need to be separated by another |.

Note.pngNote:Any page can be transcluded by another one actually. A transclusion of the Main Page can be done using {{:Main Page}}, but we don't do this here because it would add all of the headlines of the Main Page to the table of contents of this page.

Examples

Here's a template where we don't define any parameters, you just drop it right in. If you visit Template:Restart, you'll see that it's just those five words.

{{restart}} → Requires restart to take effect.

The Template:Ent is a template that can accept up to two unnamed parameters. The order of unnamed parameters matters.

{{ent|sv_cheats|1}}sv_cheats 1

Template:KV is one of the most common templates used. It accepts multiple optional named parameters such as only and nofgd. Named parameters can be defined in any order.

{{KV|only={{css}}|ammo|nofgd=1|integer|Amount of reserve ammo to be added. Fallback value is 0.}}
ammo ([todo internal name (i)]) <integer> (only in Counter-Strike: Source) !FGD
Amount of reserve ammo to be added. Fallback value is 0.

Without the |nofgd=1, the !FGD part would not have displayed.

Note.pngNote:Unnamed parameters can be specified like named parameters in any order, like so: {{ent|2=1|1=sv_cheats}}sv_cheats 1
Note.pngNote:When calling a template, you can always specify any number of named and unnamed parameters. The only question is whether the template regards them or not, yielding a different result or the same. By the way, specifying a parameter multiple times displays an error at the top of the page.

Templates can also use templates, named nesting. Recursion is not supported, so a template cannot use itself.

Substitution

This is for advanced users. Instead of transcluding a template, one can choose to substitute it. Substitution will replace the wikitext of a template call with the contents of the template. Do not substitute carelessly, because the substituted wikitext will not be updated when the template is. See Wikipedia:Help:Substitution for more information.

To substitute a template, transclude it like you normally would, then add subst: between {{ and the template's name. After that, click the save button and the wikitext will automatically be added.

For example, if you write {{restart}} on a page, save it, and edit the page again, you will still find {{restart}} at the same place in the wikitext. In contrast, if you save {{subst:restart}} and edit the page again, you'll find Requires restart to take effect. instead. It can be imagined that the wiki "copy-pastes" the content over, but it does regard parameter values:

{{subst:delete|This is a bad page.}}

If a page is saved with this, that text will be replaced with the content of Template:Delete where every occurrence of {{{1}}} is replaced with This is a bad page.:

{{Delete-meta|{{#if: This is a bad page. | This is a bad page. }} }}[[Category:Candidates for speedy deletion]]

Note the automatic forwarding of parameters. When substituting, the page should not appear any differently than it would if transcluded. The only difference is in the page code.

Tip.pngTip:When editing, be sure to make use of View Changes before saving substitutions to see what you're actually doing to the wikitext.

Making Templates

Making a template like Template:Restart is rather easy - just type the text you want, and save it. What about ones with parameters?

Tip.pngTip:When making templates, you may want to space out your code to make it easier to read, but watch out for unintentional whitespace. HTML comments (<!-- -->) can also be useful.
Note.pngNote:Named parameters (such as {{{title}}}) will have leading and trailing whitespace trimmed in the template's result, unnamed parameters (such as {{{1}}}) will not.

Unnamed Parameters

To add an unnamed parameter, simply put {{{1}}} where you want the value of the first unnamed parameter that the user might have specified to be inserted. Here's a part of the code for Template:Tip:

Tip:{{{1}}}

If you've seen this template before you know that it has its own special look, but this is all we will look at for now. All the user has to do when transcluding this is enter the text they want:

{{tip|Do not carve without vertex editing afterward.}}
Tip.pngTip:Do not carve without vertex editing afterward.

If you want to add more than one unnamed parameter, simply change the number. Here's the old (condensed) code for Template:Distinguish:

:''Not to be confused with [[:{{{1}}}]]{{#if:{{{2|}}} |{{#if:{{{3|}}} |, [[:{{{2}}}]]| or [[:{{{2}}}]].}}|.}}{{#if:{{{3|}}} |{{#if:{{{4|}}} |, [[:{{{3}}}]]|, or [[:{{{3}}}]].}}}}{{#if:{{{4|}}} |, or [[:{{{4}}}]].}}''

This template has some things we haven't talked about yet, but you can still see that there's four unnamed parameters used: {{{1}}}, {{{2}}}, {{{3}}}, and {{{4}}}.

All the user has to do when transcluding is this:

{{distinguish|Combine|Civil Protection|Overwatch}}
Not to be confused with Combine, Civil Protection or Overwatch.

Named Parameters

Usually you would want to have named parameters affect anything only if they are defined when being transcluded. We'll talk about conditions later. For now, let's look at Template:IO, which has many named parameters. In this template, {{{param}}} marks a place to add wikitext that's defined by |param=texthere when transcluding.

With named parameter:

{{IO|SetString|Updates the string.|param=string}}
SetString <string>
Updates the string.

Without named parameter:

{{IO|SetString|Updates the string.}}
SetString
Updates the string.

Default Value

To make a parameter have a value by default, add a | to the right of the parameter name, and then define the value. Both named and unnamed parameters can use this.

{{{1|3000}}}

This would set the value for 1 to 3000 if the user does not specify it.

{{{value|}}}

This returns nothing. Without the |, it would literally return {{{value}}} as text, if it hasn't already been defined at some other point.

Parser Functions

To make text (dis)appear only if a certain parameter is defined or set to a specific value, the following expressions must be used.

#if: checks if a string is empty or not. The syntax is {{#if: <string> | <then> | <else> }}. This expression evaluates to <then> iff <string> is the empty string, otherwise to <else>. The <else> value can be omitted in which case it defaults to the empty string; The same applies to the following <else>s.

{{#if: {{{target|}}} | Target aqcuired | Sleep mode activated... }} → Sleep mode activated...
{{#if: Something is there! | Target aqcuired | Sleep mode activated... }} → Target aqcuired
Note.pngNote:The expression {{{target|}}} returns the empty string because you (probably) are not viewing this page through a transclusion, so it's never had a chance to be defined.

#ifeq: checks for equality between two strings. The syntax is {{#ifeq: <string1> | <string2> | <then> | <else> }}. This evaluates to <then> iff the two (trimmed) strings are entirely equal, otherwise to <else>.

{{#ifeq: {{{target|}}} | friend | Friend... | Go away! }} → Go away!
{{#ifeq: friend | friend | Friend... | Go away! }} → Friend...

#switch: checks for equality between an input string and multiple strings. The syntax is {{#switch: <input> | <string1> = <value1> | <string2> = <value2> | ... | #default = <default> }}. This statement evaluates to the corresponsing value of the first <stringX> that equals the <input>. If that value is empty, then the value of the next non-empty string is used instead. If no equality is found, <default> is returned which defaults to the empty string if not specified.

#expr: solves math problems. See Help:Calculation for all it's abilities.

{{#expr: 2 + 2}} → 4
{{#expr: cos(0)^2}} → 1

#ifexpr: tests whether a math expression is true or false and can returns different values depending on it.

{{#ifexpr: 6 + 3 = 9 | Right | Wrong }} → Right
{{#ifexpr: 6 + 3 = 23 | Right | Wrong }} → Wrong

Documentation

Please give a description of what your template does, and especially examples. To keep this describing text from appearing on pages that use the template, there are three different HTML tags you can use.

  • <noinclude>...</noinclude> makes wikitext inside it not appear on the destination page, while keeping it on the template's page.
  • <onlyinclude>...</onlyinclude> makes only wikitext inside it appear on destination pages. Text not inside these will still appear on the template's page.
  • <includeonly>...</includeonly> makes wikitext inside it not appear on the template page. It has no effect on the destination page.

They can sound very confusing at first. If you're confused on how to use them, check the source code for a template, because almost all use them for one purpose or another.

If the documentation cannot be kept short, then it is a good idea to move all explanations and/or examples to an own page. By convention, the documentation page of a template should be its subpage /doc. For instance, Template:Note has its documentation page Template:Note/doc. When created, the documentation is transcluded to the template page using just the expression {{documentation}} which of course must be excluded using the above three tags.

Sometimes, templates are used identically. As you might know, Template:Tip and Template:Note both use their one parameter in exactly the same manner, so there is no need for another page with an identical documentation for Tip. Tip can use the same documentation as Note using the expression {{documentation|Template:Note/doc}}; The only magic behind this is that Template:Note/doc uses the expression {{ROOTPAGENAME}} instead of Note for its examples so that the examples adapt to the page that they are displayed on. If Template:Note/doc wasn't made for this, this wouldn't work out. Other "generic docs" like this that are in use are Template:Hl2 and Template:Yes.

Templates not updating

If you've recently edited a template and the changes are not applying on pages that it's been transcluded to, add ?action=purge at the end of the URL for those pages. This will tell the server to update the page's HTML immediately. You can achieve the same effect by editing a page and saving it without making any changes. If you're on a template page with a documentation, you can also use the "[purge]" button for the same effect.

Template Shortcuts

Some templates may have template shortcuts, which are redirects that are abbreviated or otherwise different forms of their target templates. Template shortcuts can be transcluded just like their target templates.


Useful Templates

All templates in green text are that color so that they stand out against the greyscale tones of most pages. Most templates with that color also automatically add pages they are transcluded on into Category:TODO.

Per-game Templates

All games have templates named by their shortcut that can deliver their associated icon and/or a link to their page. See Category:Game icons for a full list of game shortcuts. All of them accept the same set of parameters that are described on every template page. The following table should give examples and also give ideas on when to use them.

Wikitext Example Description Formerly used template
{{<shortcut>}} {{hl2}} Half-Life 2 Displays the game's icon which links to its game's page and shows the game's name as a hover text. Putting this at the beginning (or end) of a word or line is the shortest and most common way of clarifying that something applies only to a specific game, but there are more ways.
{{<shortcut>|2}} {{hl2|2}} Half-Life 2 Half-Life 2 Displays the game's icon followed by its name which both link to the game's page. Useful in sentences when the icon alone is too little but the next style is too much. {{game link}}
{{<shortcut>|4}} {{hl2|4}} Half-Life 2 Half-Life 2 Does the same but using colorful text which grabs more attention, so don't overuse this on a page. Especially if you name the same game multiple times in a text, you definitely don't need a long, colorful link every time, let alone a link. {{game name}}
{{<shortcut>|in}} {{hl2|in}} (in Half-Life 2) Can be used to indicate that something applies to a specific game. Useful at the end of a line or key word; The same applies to the following variants. {{in}}
{{<shortcut>|since}} {{portal2|since}} (in all games since Portal 2) Can be used to quickly note features that were added in a game and are available in all Source games afterwards. {{since}}
{{<shortcut>|only}} {{csgo|only}} (only in Counter-Strike: Global Offensive) Indicates features that are exclusive to a specific game. {{only}}
{{<shortcut>|also}} {{as|since}} {{gmod|also}} (in all games since Alien Swarm) (also in Garry's Mod) Notes that earlier game also has a feature, usually backported from newer engine branches. These should be used with in conjunction with another game notice template. {{also}}
{{<shortcut>|removed}} {{l4d|removed}} (removed since Left 4 Dead) Indicates that a feature was removed in a game and all later engine branches. {{removed}}
{{<shortcut>|not}} {{czds|not}} (not in Condition Zero Deleted Scenes) Indicates that a feature might be in other games but not in a specific one. {{not}}


Inline Note Templates

The following are some of the inline note templates.

Description Wikitext and Result
Template:Bug notifies readers of a bug. {{bug|The amount is double what it should be. Be careful!}}
Icon-Bug.pngBug:The amount is double what it should be. Be careful!  [todo tested in ?]
Template:Clarify marks things that should be clarified. PAS is a kind of bounding-box for Player or NPC AI sound detection.{{clarify}}
PAS is a kind of bounding-box for Player or NPC AI sound detection.[Clarify]
Template:Confirm marks something that needs to be confirmed. It's green color is meant to stand out. {{confirm|Always goes to the left.}}
Confirm:Always goes to the left.
Always goes to the left.{{confirm}}
Always goes to the left.[confirm]
Template:Distinguish lets you notify users about pages that share similar names or may be confused for something else. {{distinguish|"Follow Freeman!"|desc1=The HL2 chapter}}
Not to be confused with "Follow Freeman!" (The HL2 chapter).
Template:How asks the question how? Players can get past these.{{how}}
Players can get past these.[How?]
Template:Idea is a nifty way to suggest ideas. {{idea|Reward players for being clever and creative, instead of forcing things to be only one way.}}
Tip.pngIdea:Reward players for being clever and creative, instead of forcing things to be only one way.
Template:Note is for making notes stand out more. {{note|This will spawn at the map origin if you do not specify the position.}}
Note.pngNote:This will spawn at the map origin if you do not specify the position.
Template:Tip marks text as a tip to readers. {{tip|This is a much less tricky process when using the vertex edit tool as well.}}
Tip.pngTip:This is a much less tricky process when using the vertex edit tool as well.
Template:Todo marks things that need to be done. It's green color is meant to stand out. {{todo|Find where this is in the game files.}}
To do: Find where this is in the game files.
Template:Warning marks things that readers should take caution of when doing something. {{warning|This tool has been known to corrupt files. Try an alternative listed below.}}
Warning.pngWarning:This tool has been known to corrupt files. Try an alternative listed below.
Template:Why asks the question why? This shader has been deprecated.{{why}}
This shader has been deprecated.[Why?]


Notice Templates

Description Wikitext and Result
Template:Cleanup marks a page that needs to be fixed up, preferably by someone knowledgeable. The text message is optional. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. {{cleanup|The last section needs to be clarified.}}
Template:Delete marks a page that should be deleted. If you do not give sufficient reason for the notice on the transclusion or the talk page, expect it to be removed by someone else. When putting this on a page, you should also list the reason on that page's talk page, for any future readers that may want to know the purpose of the deletion. {{delete|This is not a real thing.}}
Template:Merge is a notice that notifies editors that it's been suggested for two or more pages to be combined into one. All merges should be discussed before being done. {{merge|HDR}}
Template:Messagebox provides a standard message box. This template is used by many notice templates, such as merge and cleanup. {{messagebox|text=Remember to follow wiki etiquette.}}
Template:Morescreenshots marks pages that should have more images on them. It allows for an optional text message to clarify what needs images. {{morescreenshots|$envmapcontrast, $envmapsaturation}}
Template:Obsolete marks things that should no longer be used. Accepts three parameters, entity, tool, and shader. {{obsolete|entity=1}}
Template:Spammer marks users that should be banned for spamming. For suspicious but not bannable behavior, there is also Template:Minor Spammer.
Icon-Bug.pngBug:This template's formatting may look weird sometimes. It's intended to be the only thing on a page.  [todo tested in ?]
{{spammer}}
Spammer.jpg
Note.pngNote:This user is a spammer, vandal or other problem poster and should be considered for a ban

Template:Split-apart marks pages that should be split into multiple pages. All splits should be discussed before being done. {{split-apart}}
Template:Stub marks pages that are very small. See Help:Stubs for info on using. {{stub}}
Template:Translate marks pages where translation is needed and adds the page to a category. This template exists in multiple languages, so for a German page, don't add {{translate}} but instead {{translate:de}}. {{translate}}
Template:Update marks outdated pages. {{update}}
Template:Wip marks pages that are in the middle of major edits. The adder requests that other users do not edit in the meantime. {{WIP|~~~}}


Miscellaneous Templates

These templates have the purpose of helping the editor.

Description Wikitext and Result
Template:= is a template that only returns an equal sign. The character is sometimes needed because multiple wiki features make use of it. Especially, the equals sign is a special character in template calls, so if an equals sign should be passed as a parameter value, then {{=}} is needed for "escaping". For the same purpose, there is also Template:! for a pipe, Template:((( for curly brackets and many more, see Category:Templates for within templates. {{=}}
=
{{note|If x {{=}} 0, you lose.}}
Note.pngNote:If x = 0, you lose.
Template:Clr clears the vertical space to the left and right of floating tables, floating images etc. To clear only one side, use {{clr|left}} or {{clr|right}}. This is commonly used before headlines to push them down so that they don't appear next to an image. In the example on the right, one could also use {{clr|left}} for the same effect. [[File:Skull and crossbones.png|50px|left]] This text is next to the image.{{clr}}This text is below the image.

Skull and crossbones.png
This text is next to the image.
This text is below the image.
Template:Ent is a really small template for making text that's both code and a link. {{ent|noclip}}
noclip
Template:Expand or Template:ExpandBox allows you to hide stuff inside a box that can be shrunk down so that it doesn't make pages as long. class="mw-collapsible mw-collapsed" style="background:rgba(0,0,0,0.05) ;float:no;margin-bottom:1em;margin-left:0;padding-right:0.5em;border:1px solid rgba(255,255,255,0.1); border-left:solid 1px #8bb9e0; padding-left:1em;"

|- | {{ExpandBox|{{KV BaseEntity|noscroll=1}}}}


|- | Template:Lang stands for language. This page itself uses the lang template, using the wikitext {{lang|Help:Templates}}. The lang template creates flags at the top right corner of a page such as English Русский 简体中文 and thus must be the first template to be transcluded to be in the right position.

Every page can and should use this template as it lets the reader know of the existence of (correctly titled) language pages of the current page and clicking on the flags links to them. Read more on Template:lang. | {{lang|Help:Templates}}
The result is at the very top of this page.

|- | Template:Param displays the values like parameters in the way that they are used in templates. Useful for template documentations. | {{param|color|#fff}}
{{{color|#fff}}}

|- | Template:Shortcut displays a small box noting (abbreviated) redirects to a page.

| {{shortcut|VDC:AL}}

Shortcut
VDC:AL

|- | Template:Tl stands for Template Link. It creates a link to a template surrounded by {{ }}. | {{tl|note}}
{{note}} |- | Template:Tl2 does the same but using <code> formatting. It also accepts parameters that act like parameters for the template that is linked to. | {{tl2|note|Example}}
{{note|Example}} |- | Template:Tlc does the same but not creating a link, which is useful when trying to display template examples (like this entire page!). | {{tlc|note|Example}}
{{note|Example}} |- | Template:Toc-right shifts the table of contents over to the right side of a page. | For an example, see Half-Life 2 map reference.

|- | Template:Unsigned is for talk pages. It should be added at the ends of unsigned comments. | {{unsigned|JeffLane}}
Unsigned comment added by JeffLane (talkcontribs) Always sign your posts with four tildes (~~~~) |}

Magic Words

Magic words are special character strings that are kind of like templates. To apply one, simply type it on the page.

__TOC__

Forces the table of contents to be placed at this spot.

__FORCETOC__

Forces the table of contents to be placed at its normal spot. (Only useful on pages that don't have enough sections to automatically display a TOC.)

__NOTOC__

Hides the table of contents.

__HIDDENCAT__

Marks a category as hidden. To make the website show hidden categories for you, check the Show hidden categories box in Special:Preferences.

{{DISPLAYTITLE:title}}

Changes the title of a page at the top bar only.

See Also