Help:Templates: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
(mainspacing: converted examples to transclusions for simplicity and (possibly) lower maintenance, added css to restyle the awful table-in-(wiki)table behavior in some examples (User:KokoroSenshi/Sandbox/Help:Templates&oldid=466313))
m (→‎Transclusion and substitution: Clearing up what appears to have been a tiny typo/mixup. Generally templates should not be transcluded? No, rather generally they should not be substituted...)
 
(22 intermediate revisions by 8 users not shown)
Line 2: Line 2:
:''See also: [https://www.mediawiki.org/wiki/Help:Templates Help:Templates on MediaWiki]''
:''See also: [https://www.mediawiki.org/wiki/Help:Templates Help:Templates on MediaWiki]''


'''Templates''' are just that: templates that can be used on any page to standardize some element, by simply filling in the required information for that particular situation. There are many kinds of templates, each serving a different goal.
A '''template''' is a page made to be included in other pages. They standardize content or formats that need to be repeated on many pages, by encapsulating them in a separate page in the <code>Template</code> {{Dict|namespace}}. They can abstract away complicated syntax, namely {{Mediawiki|parser functions}}.


Essentially, a template is a separate page in the "Template" {{Dict|namespace}}. By including the name of that page enclosed in '''<nowiki>{</nowiki>{two curly brackets}}''' and placing it on another page, the entire contents of that template page will be displayed where you've placed it - this is called [[Help:Glossary#Transclusion|transclusion]]. Note that the Wikitext typed remains as it was typed, while when reading the page it is replaced by the template content. For the Wikitext to change as well, [[Help:Glossary#Substitution|substitution]] must be used. Many templates have {{Dict|parameter}}s, or fields, that modify its appearance and content, so it can be customized to any situation.  
Templates are most often used by {{Mediawiki|transclusion}}. That is, by enclosing the name of the template page in <code><nowiki>{{double curly brackets}}</nowiki></code>. When placed in another page, the entire contents of that template page will be displayed where you placed it. Templates can have {{Dict|parameter}}s that modify their appearance or content.


== Types of Templates ==
An example of a common template is an '''infobox''', such as [[Template:Infobox Item]]. Infobox templates appear in the upper right corner of nearly every article on the wiki. There are many other [[/Types|types of templates]].
=== Navigation Templates ===
:''See all [[:Category:Navigation Templates|navigation templates]]''
Navigation templates are used to link together pages with related subjects, for the benefit of readers. As the name suggests, they facilitate navigation between these pages, by providing an organized set of links to other articles. They are typically placed at the bottom of pages. Navigation templates contain little or no {{Dict|parameter}}s to modify.


Examples of navigation templates include {{[[Template:Songs|Songs]]}} or {{[[Template:Pickups|Pickups]]}}. {{Dict|Image map}}s are useful for making navigation templates such as {{[[Template:STNavMap|STNavMap]]}}, by allowing the reader to click different places on an image to navigate to other pages.
==Using Templates==
===Parameters===
Templates can have anonymous parameters, named parameters, or both. With anonymous parameters, order matters.


=== Infoboxes ===
[[Template:Color]] is a template with anonymous parameters. It is used like this: <code><nowiki>{{Color|TWWHD Vermilion|merchant's oath}}</nowiki></code>, which produces {{Color|TWWHD Vermilion|merchant's oath}}. You wouldn't get the right output if you changed the order of the parameters.
:''See all [[:Category:Infobox Templates|infobox templates]]''
Infobox templates - typically placed near the top of pages, beneath notice templates - provide a summary of the article's subject. Each infobox template will have several specific fields which cover topics relating to the subject. For example, {{[[Template:Game|Game]]}} has fields for the game's release date, the publisher, the ESRB rating, etc.


=== Notice Templates ===
[[Template:Clarify]] is a template with both anonymous and named parameters. It is used like this: <code><nowiki>{{Clarify|BotW|reason= Some text here}}</nowiki></code>. There's one anonymous parameter for the game, and a named <code>reason</code> parameter for the display text.
:''See all [[:Category:Notice Templates|notice templates]]''
These templates inform users about present conditions or situations that a given article is currently in. They are placed at the top of pages. Most notice templates temporarily mark [[:Category:Articles needing attention|articles needing attention]], calling for editors to fix them. For example, {{[[Template:Sources|Sources]]}} marks articles lacking sources, {{[[Template:Merge|Merge]]}} marks articles proposed for [[Help:Merging Pages|merging]], and so on. When such templates beneficial to editors are placed on a page, these templates automatically the page to {{Dict|maintenance category|maintenance categories}} so editors can find them. The templates are removed once the corresponding issues are addressed. Some notice templates have a date parameter to show how long an article has been flagged.


Some notice templates are placed permanently on pages. These are for the benefit of readers rather than editors. For example, {{[[Template:Noncanon|Noncanon]]}} is permanently placed on articles or sections that cover [[Zelda Wiki:Canon Policy|non-canon]] topics.  
===Transclusion and substitution===
Templates can be used by {{Mediawiki|transclusion}} or by {{Mediawiki|substitution}}. When you '''transclude''' a template on a page and save it, the source will still show <code><nowiki>{{<Template name>}}</nowiki></code> when you go back to edit it. Conversely, when you '''substitute''' a template, the actual contents of the template gets copied and saved to the page.


=== Formatting Templates ===
{| class="wikitable"  
:''See all [[Help:Template List|formatting templates]]''
|+ Transclusion vs. substitution after saving the page
Formatting templates help the standardization of formatting across the Wiki - they essentially mold what you've written to appear a certain way. An excellent example would be the {{[[Template:Cite|Cite]]}} template, which ensures that all in-game citations in references appear the same and consistent throughout the entire site. These templates also make formatting quicker and simpler and reduce mistakes - take the [[Help:Template List#Game Shortcuts|game shortcuts]], for example.
! Input !! Output view !! Output source
 
Formatting templates may contain extra parameters to modify it's appearance when customization is desired.
 
=== Inline Templates ===
:''See all [[:Category:Inline templates|inline templates]]''
Inline templates display messages within an article's text, and are a type of notice template. They are essentially miniature notice templates: instead of marking entire articles, they mark specific sentences in articles. Like regular notice templates, an inline template identifies a problem with a sentence and is removed once an editor addresses the problem. {{[[Template:Fact|Fact]]}}, {{[[Template:Verify|Verify]]}}, {{[[Template:Clarify|Clarify]]}}, {{[[Template:Which|Which]]}}, {{[[Template:Whom|Whom]]}}, and {{[[Template:How many|How many]]}} are examples of such templates. {{[[Template:Name|Name]]}} is a permanent inline template used to mark conjectural or fan-made names.
 
== Making a Template ==
The easiest way is to type '''<nowiki>{</nowiki>{your template name}}''' to the [[Zelda Wiki:Sandbox|Sandbox]], and click on the red link that appears after saving or previewing. At the resulting editing page, you can create your template, which is most easily done by copying and pasting the code from a similar template; then you can just modify it.
 
Make sure that directly after the end of your template text (not even leaving a space nor new line!) you add <nowiki><noinclude></nowiki> to begin any section detailing how to use the template, and also the add the necessary category for that template, and at the very end type <nowiki></noinclude></nowiki> to enclose the section and category.
'''Do not''' finish the template, create a new line, and ''then'' add the <nowiki><noinclude></nowiki> tag.
 
===Testing a Template===
When editing a template, a "preview page with this template" option will appear at the bottom of the edit form. In the "page title" box, enter the name of a page that currently uses the template and pressing the adjacent "show preview" button. This allows you to preview the template as it would appear on that page if you had saved the edit.
 
The template sandbox [[Template:Test]] (in the list of sandboxes at [[Zelda Wiki:Sandbox]]) can be used to test your templates.
 
{{Dict|Sandbox}}ed templates can also be tested on pages using [[Special:TemplateSandbox]]. Please refer to [https://www.mediawiki.org/wiki/Extension:TemplateSandbox#Usage MediaWiki] for more information on this feature.
 
Alternatively, since one can {{Dict|Transclusion|transclude}} not only Templates but ordinary pages (e.g. <code><nowiki>{</nowiki>{:Bombchu}}</code> will display the entire bombchu article content), then for example you can create your own template sandbox on <code><nowiki>http://zeldawiki.org/User:{MyUserName}/Sandbox/Template:Testing</nowiki></code>, and type <code><nowiki>{</nowiki>{:User:{MyUserName}/Sandbox/Template:Testing}}</code> into a sandbox to use it.
 
In addition, after making a template, you can view it or troubleshoot issues with [[Special:ExpandTemplates]], which will expand all templates recursively, i.e. repeatedly substituting all template (and templates in templates) until no <code><nowiki>{</nowiki>{ ... }}</code> remain.
 
==Categories==
Many templates automatically {{Dict|category|categorize}} pages when used. For example, an article tagged with {{[[Template:Sources|Sources]]}} will automatically be added to [[:Category:Articles lacking sources]].
 
====Category Suppression====
Templates with this feature will usually have an option to disable automatic categorization. This is known as {{Wp|WP:CATSUP|category suppression}}. Category suppression is useful when using a template for something other than its intended purpose - for instance, a template gallery or list, such as the one above.
 
Some templates automatically suppress categories when used in the "User" namespace. This prevents these articles from appearing in categories intended for the {{Dict|mainspace}} only.
 
== Examples ==
The following is a list of popular notice and inline templates. A list of formatting templates can be found [[Help:Template List|here]].
<!--
  Use Special:ExpandTemplates on the Template pages, inspect the styles to override inheritance from Wikitable, usually
  background-color: #1d578b;                  for the table/mbox (?) and
  border: medium none; background: none;      for inner cells (I note to myself: cells, not tags)
  Mboxes NO LONGER have to be expanded to apply the above override styles
  ...however, without expanding/substituting, category suppressing may be harder for those without nocat parameters
-->
<css>
#restyle table td:nth-last-child(2), #restyle table td + td, #restyle table.gradient td {
  border: medium none !important;
  background: none !important;
}
#restyle table td[width] {
  border: 1px solid #426787 !important;
  background-color: #1d578b !important;
}
</css>
{| id="restyle" class="wikitable" cellpadding="2" style="color: #D2D2D2; border: 1px solid #426787; margin: 0 0 1em 1em; border-collapse: collapse; font-size: 95%; text-align: left;"
! colspan="2" style="text-align: center; background-color: #1d578b; border: 1px solid #426787;" | '''Notice Templates'''
|-
! <pre style="padding: 2px; margin: 2px;">What to type</pre> and What it's for !! What it makes<!--
 
-->
|-
|<pre>{{Accuracy}}</pre> Alert readers to disputed accuracy.
| {{Accuracy|nocat}}<!-- nocat
 
-->
|-
|<pre>{{Ambig}}</pre> Alert readers to ambiguous canon status.
| {{Ambig}}<!-- Only categorizes on the Main namespace, according to the code.
 
-->
|-
|<pre>{{Archive}}</pre> or <pre>{{Archive|<Page Name>|<Other namespace>}}</pre> Alert readers that they can read but should not edit the archive. See [[Template:Archive]] for options.
| {{Archive}}<!-- No cat
 
-->
|-
|<pre>{{Archives|~Start}}
* <A link to an archive>
* <A link to an archive>
* <...and so on!>
{{Archives|~Stop}}</pre> A nav template to get to archived versions. (Note: It floats to the right.)
|
{{Archives|~Start}}
* <A link to an archive>
* <A link to an archive>
* <...and so on!>
{{Archives|~Stop}}<!-- No cat
 
-->
|-
|<pre>{{Improve|<date>|<game>}}</pre> Used to identify pages in general need of improvement. Replace <nowiki><</nowiki>date> with that day's date or ~<nowiki>~~</nowiki>~~, and <nowiki><</nowiki>game> with a valid name from [[Template:Zelda#Usable Names|here]]
| {{Improve|<date>|nocat}}<!-- nocat
 
-->
|-
|<pre>{{Copyvio}}</pre> or <pre>{{Copyvio|action= |category= }}</pre> Alert editors to potential copyright issues. See [[Template:Copyvio]] for information on <action> and <category>.
| {{Copyvio|category=nocat}}<!-- nocat
 
-->
|-
| <pre>{{Imdel|<reason code>|<second file name>}}</pre> Alerts staff to an image to be deleted, and a reason. See [[Template:Imdel]] for parameter information.
|
{| id=mbox style="margin:0 auto 1em; padding:3px 5px; border: 1px solid #426787; background-color: #1d578b;"
|-
|-
| style="padding: 2px 0px 2px 0.5em; text-align: center; padding-right:5px" | [[File:Midna03.png|50px]]
| <code><nowiki>{{MM}}</nowiki></code>      || {{MM}}      || <code><nowiki>{{MM}}</nowiki></code>
| style="font-size: 14px" | '''It has been suggested that this image be deleted because it meets Zelda Wiki's [[Zelda Wiki:File Deletion Policy|deletion standards]].'''
<span style="font-size: 13px;">If you disagree with the deletion of this image, discuss this on the image's <span class="plainlinks">[http://zeldawiki.org/ExpandTemplates <span title=":ExpandTemplates">talk</span>]</span> page. Please do not place this template on a file until you have removed all links to the file.</span>
|}<!-- Unable to suppress category
 
-->
|-
|-
| <pre>{{Delete|<reason>|<date>}}</pre> Alerts staff to an article to be deleted, preferably after seeking consensus.
| <code><nowiki>{{subst:MM}}</nowiki></code> || {{#switch:{{lc:{{{1}}}}}
| {{Delete|<reason>|<date>|nocat}}<!-- nocat
|-       = ''Majora's Mask''
 
|himekawa = [[The Legend of Zelda: Majora's Mask (Himekawa)|''Majora's Mask'' {{#if:|(Himekawa)|manga}}]] {{#if:||by [[Akira Himekawa]]}}
-->
|item    = [[Majora's Mask (Item)|Majora's Mask]]
|-
|object  = [[Majora's Mask (Item)|Majora's Mask]]
| <pre>{{Disambig}}</pre> Alerts readers that the page is a disambiguation page for articles of the same name, designed to list these articles. Such a page is usually found from performing a search. (An article should not link to such a page if the intended topic has its own specific article).
|#default = ''[[The Legend of Zelda: Majora's Mask|Majora's Mask]]''}} || <code><nowiki>''[[The Legend of Zelda: Majora's Mask|Majora's Mask]]''</nowiki></code>
|
----
----
<div class="notice metadata" id="disambig">
{|
|style="vertical-align:middle; border: medium none;"|''This is a [[Help:Dictionary#Disambiguation|disambiguation]] page: a list of articles associated with the same title. If an [[Special:Whatlinkshere/Help:Templates|internal link]] referred you to this page, you may wish to change the link to point directly to the intended article.''
|}
|}
</div>
{{Small|In reality, [[Template:MM]] outputs something quite different when substituted, but this illustrates the point.}}
----
----<!-- Unable to suppress category
 
-->
|-
| <pre>{{Fact}}</pre> or <pre>{{Fact|<game>}}</pre> (Inline template) Notifies editors that a source is needed for a statement. See [[Template:Fact]] for specifying which game(s) it relates to (<game>).
| {{Fact|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Future game}}</pre> or <pre>{{Future game|<cat sort>}}</pre> Use on content concerning unreleased material. See [[Template:Future game]] for <cat sort>.
| {{Future game|nocat}}<!-- nocat
 
-->
|-
| <pre>{{GalleryPage}}</pre> or <pre>{{GalleryPage|<gallery page name>}}</pre> If the article topic has its own gallery page, use to send viewers to this page. (Gallery:Link used for <nowiki><</nowiki>gallery page name> in this example)
| {{GalleryPage|Gallery:Link}}<!-- No cat
 
-->
|-
| <pre>{{Guide}}</pre> or <pre>{{guide|<area>|<date>|<cat sort>}}</pre> Notifies editors to remove the strategy guide style of the article. For <nowiki><</nowiki>area>, put Article or Section corresponding to where the template needs to be, and is, placed.
| {{Guide|<area>|<date>|nocat}}<!-- nocat
 
-->
|-
| <pre>{{subst:Howtosig}}</pre> A message to inform people that haven't been signing their talkspace posts. Use this as a message on their User Talk page. Note that the template does not automatically sign it for you.
|
== Signatures ==
Hello, <nowiki><</nowiki>User>! I noticed that you seem to be having some trouble with the signature coding — don't worry, it happens a lot. You only need to type one thing:
:'''<big><nowiki>~~~~</nowiki></big>'''
That's it. Just those four tildes. They automatically add your name and the time you made your post, so you don't have to type any of that yourself!<!-- No cat, but need to address <User>, plus NOEDITSECTION (https://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches)
 
-->
|-
| <pre>{{subst:Hi}}</pre> A message the bot will automatically send to all new users.
|
== Hello ==
{| style="border: 1px solid #426787; background-color: #1d578b; margin:0 auto;"
|-
| style="border: medium none; background: none;" | [[File:Zwlogo2dsmall.png|71px|left]]
| style="border: medium none; background: none;" | Hi there, <nowiki><</nowiki>User>, and welcome to '''Zelda Wiki'''! Why not check out the community hub, [[Zelda Wiki:Castle Town|Castle Town]]? To find out what's been going on recently at the wiki and what articles users are editing right now, head to the [[Special:RecentChanges|Recent Changes]]. For general wiki-related discussion and questions, head over to [[Zelda Wiki:Discussion Center|Discussion Center]]. Also, for wiki usage and policy help, check out our [[Help:Contents|Help Guide]]. We hope you enjoy the wiki. Thanks! — [[Zelda Wiki:Staff|The Zelda Wiki Staff]]
|}<!-- No cat, but need to address <User>, plus NOEDITSECTION (https://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches)
 
-->
|-
| <pre>{{Images}}</pre> or <pre>{{Images|<game>}}</pre> Post this on articles lacking images.
| {{Images|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Incomplete Coding}}</pre> Note that not all browsers are equal. Some users may place this on articles that seem fine, but are a mess in their browser, so even if it looks fine, if possible don't remove it before asking the one who placed it.
| {{Incomplete Coding|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Bad lead}}</pre> Used to flag a lead (or lede) that does not properly summarize its article's contents.
| {{Bad lead|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Merge|Link|Princess Zelda|<etc.!>|<up to 20!>}}</pre> For example, when placed on article A, it is used to suggest that article A is [[Help:Merging Pages|'''merged''']] with Link, Princess Zelda, ... . It should appropriately be placed on Link, Princess Zelda, ... also.
| {{Merge|Link|Princess Zelda|<etc.!>|<up to 20!>|cat=none}}<!-- nocat (cat=none)
 
-->
|-
| <pre>{{Move|<to here>}}</pre> or <pre>{{Move|<to here>|<or maybe here>}}</pre> Use to recommend moving a page to a new title.
| {{Move|<to here>|<or maybe here>|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Name|<Name>}}</pre> This template indicates names that are purely fan creations.
|
<b>{{Exp|Fan-created name|<Name>|lightblue}}</b><!-- Unable to suppress category
 
-->
|-
| <pre>{{Neutrality|<cat sort>}}</pre> Notifies editors of potential bias on a subject.
| {{Neutrality|nocat}}<!-- nocat
 
-->
|-
| <pre>{{News Archive}}</pre> A hybrid notice and navigation template for the News archives.
| {{News Archive}}<!-- No cat
 
-->
|-
| <pre>{{Noclog}}</pre> Helps clear out the Wanted Pages. [[Special:WhatLinksHere/Template:Noclog|Pages that use it]].
| {{Noclog}}<!-- No cat
 
-->
|-
| <pre>{{Noncanon}}</pre>
or wrap some content:
<pre>
{{Noncanon|Start}}
Content
{{Noncanon|End}}
</pre> Alerts readers to the canon status of an article or, in the latter, article section. The former is used to illustrate:
| {{Noncanon}}<!-- Only categorizes on the Main namespace.
 
-->
|-
| <pre>{{Nosig|<username>|<date/time>}}</pre> Identify talkspace posters that did not sign the post with name and time. <date> is generally ~<nowiki>~~</nowiki>~~
| {{Nosig|The Groosenator|<date/time>}}<!-- No cat
 
-->
|-
| <pre>{{subst:Nosrc}}</pre> A message to editors that uploaded images without sourcing them. Note that the template does not automatically sign it for you.
|
==Image(s) uploaded==
Hi! Thank you for the new image(s) you recently uploaded; the wiki appreciates your contributions! We've introduced a policy of crediting the original source of any images used here, so we ask that you please take a moment to let everyone know where your images came from using [[Template:FileInfo|FileInfo]]. For more information, see [[Help:Upload#Source|this explanation]], and any questions you may have will be answered by the staff [[Zelda Wiki:Discussion Center|here]]. Thanks for your help!<!-- No cat, but need to address <User>, plus NOEDITSECTION (https://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches)
 
-->
|-
| <pre>{{OT}}</pre> Informs talkspace posters that the discussion is not related to the wiki.
| {{OT}}<!-- No cat
 
-->
|-
| <pre>{{Protect|<cat sort>}}</pre> Informs the staff of a page that may need to be protected.
| {{Protect|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Protected}}</pre> Informs editors that a page has been fully protected (only administrators can edit it). It is a key icon (as illustrated) to the right of page title.
|
[[File:Boss Key TP.png|25px|This page is locked either due to unconstructive edit warring or excessive vandalism, or because it contains Zelda Wiki policies.|link=Help:Protected Pages]]<!-- Unable to suppress category + only want icon, not template
 
-->
|-
| <pre>{{Split|<nowiki><</nowiki>Section Name>}}</pre> Used when suggesting an article's section be split away into its own page. 
| {{Split|<nowiki><</nowiki>Section Name>|cat=none}}<!-- nocat (specifically: cat=none)
 
-->
|-
| <pre>{{Harmonize|Link|Princess Zelda|<etc.!>|<up to 20!>}}</pre> Alerts users that an article does not properly complement some other articles, e.g. Link, Princess Zelda, etc.
| {{Harmonize|Contents|Citing Sources|<etc.!>|<up to 20!>|cat=none}}<!-- nocat (specifically: cat=none)


-->
Generally, templates should be transcluded and not substituted. Substitution does not preserve a reference to the template—it's like you didn't use a template at all. You lose the ability to have the content update automatically when you change the template.
|-
| <pre>{{Sectstub}}</pre> Marks a specific section of an article as a stub (too short). If the stub section covers multiple games, use additional parameters, e.g. <nowiki>{{Sectstub|OOT|MM|TWW|TP}}</nowiki>.
| {{Sectstub|nocat}}<!-- nocat


-->
==Making Templates==
|-
For information on how to ''make'' templates, see [[Zelda Wiki:Making Templates]].
| <pre>{{Sources}}</pre> To be placed above articles that generally lack references. If the article covers multiple games, use additional parameters, e.g. <nowiki>{{Sources|OOT|MM|TWW|TP}}</nowiki>.
| {{Sources|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Stub}}</pre> Tags an article as a stub (too short). If the stub article covers multiple games, use additional parameters, e.g. <nowiki>{{Stub|OOT|MM|TWW|TP}}</nowiki>
| {{Stub|nocat}}<!-- nocat
 
-->
|-
| <pre>{{Theory}}</pre>
or wrap some content:
<pre>
{{Theory|Start}}
Content
{{Theory|End}}
</pre> This template indicates that either a section or an entire article contains unconfirmed fan theories. The former is used to illustrate:
|
{{Notice
|text= Theory Warning
|subtext= Be advised that the following article or section contains unconfirmed, fan-made theories or speculation.
|textcolor= #FFA500
|bordercolor= orange
}}<!-- Unable to suppress category
 
-->
|-
| <pre>{{subst:Uncon|<Article Name>}}</pre> A canned (i.e. prewritten) message to send to a user (put on their talk page) after reverting an edit of theirs made on an article that was nonconstructive (See message:). Note that the template does not automatically sign it for you.
|
==Nonconstructive Edits==
Hello! The recent edit(s) you have made to the page, [[<Article Name>]], do not appear to be constructive and have been reverted. Please refrain from adding nonsense or irrelevant content to Zelda Wiki. If you are not sure what content is acceptable, then see our [[Zelda Wiki:Quality Standards|Quality Standards]]. If you would like to experiment with editing, please use the [[Zelda Wiki:Sandbox|Sandbox]]. If you feel that there has been a mistake and that you believe that your edits were valid, then report it on that page's respective talk page.<!-- No cat, but need to address <User>, plus NOEDITSECTION (https://www.mediawiki.org/wiki/Help:Magic_words#Behavior_switches)
 
-->
|-
| <pre>{{Undated|<date/time>}}</pre> Similar to the Nosig template, but specifically for signed, but not dated, talkspace posts.
| {{Undated|<date/time>}}<!-- No cat
 
-->
|-
| <pre>{{Update}}</pre> Notifies editors of articles that are out of date following the release of new information, namely new Zelda games. See [[Template:Update]] for more options.
| {{Update||nocat}}<!-- nocat (specifically: anything in 2nd parameter)
 
-->
|-
| <pre>{{User}}</pre> Filler/Placeholder information to put on a user page that has not been created and is on the [[Special:WantedPages|wanted pages list]].
| {{User}}<!-- No cat
 
-->
|-
| <pre>{{Vandalism|<Date/Time>}}</pre> Notifies editors of a frequently vandalized page's current protected status. 
|
{| cellspacing="3" align='center'
|- valign="top"
|style="border: 1px solid #{{ZWborder}}; background-color: #{{ZWheader}}"|
<div style="padding: .5em .8em .2em; max-width:64em">
<div style="float: left; margin-right:10px;">[[File:Fishman.png|100px|left|Hoy! Small fry! Your map's got nothing but ocean drawn on it!]]</div>
'''This page has recently been subject to repeated vandalism, and was protected on '''<Date/Time>'''.'''<br>
<span style="font-size: 90%">If you would like to add content, you may request that the page be unprotected on the {{talk|talk page}} (if applicable), or alternatively contact one of the active admins listed [[Zelda Wiki:Staff|here]].</span>
</div>
|}<!-- Unable to suppress category
 
-->
|-
| <pre>{{Wikipedia|<Article Name>}}</pre> Links to a Wikipedia article. The example uses <code>Satoru Iwata</code>.
| {{Wikipedia|Satoru Iwata}}<!-- No cat
 
-->
|-
| <pre>{{YouLink}}</pre> Flags articles with out-of-universe speaking style.
| {{YouLink|nocat}}<!-- nocat (specifically: anything in 1st parameter)
 
-->
|}

Latest revision as of 01:41, 19 December 2022

Zelda Wiki's
Help Guide
Basic Editing:

Getting Started
Citing Sources
Images and Uploading
Initialisms
Protected Pages
Redirects
Talk Pages
Templates (Template List)

Guidelines and Policies:

Canon Policy
Editing Etiquette
Image Deletion Policy
Inter-Wiki Policy
Nintendo Article Guidelines
Quality Standards
User Accounts
User Conduct

Advanced Editing:

Archiving Talk Pages
Article Reorganization
Custom Signatures
Keyboard Shortcuts
Merging and Moving Pages
Patrolling
Tables
User Navigation Bars
WikiExclusives

General Information

Staff
User Rights
About
Glossary

See also: Help:Templates on MediaWiki

A template is a page made to be included in other pages. They standardize content or formats that need to be repeated on many pages, by encapsulating them in a separate page in the Template namespace. They can abstract away complicated syntax, namely parser functions.

Templates are most often used by transclusion. That is, by enclosing the name of the template page in {{double curly brackets}}. When placed in another page, the entire contents of that template page will be displayed where you placed it. Templates can have parameters that modify their appearance or content.

An example of a common template is an infobox, such as Template:Infobox Item. Infobox templates appear in the upper right corner of nearly every article on the wiki. There are many other types of templates.

Using Templates

Parameters

Templates can have anonymous parameters, named parameters, or both. With anonymous parameters, order matters.

Template:Color is a template with anonymous parameters. It is used like this: {{Color|TWWHD Vermilion|merchant's oath}}, which produces merchant's oath. You wouldn't get the right output if you changed the order of the parameters.

Template:Clarify is a template with both anonymous and named parameters. It is used like this: {{Clarify|BotW|reason= Some text here}}. There's one anonymous parameter for the game, and a named reason parameter for the display text.

Transclusion and substitution

Templates can be used by transclusion or by substitution. When you transclude a template on a page and save it, the source will still show {{<Template name>}} when you go back to edit it. Conversely, when you substitute a template, the actual contents of the template gets copied and saved to the page.

Transclusion vs. substitution after saving the page
Input Output view Output source
{{MM}} Majora's Mask {{MM}}
{{subst:MM}} Majora's Mask ''[[The Legend of Zelda: Majora's Mask|Majora's Mask]]''

In reality, Template:MM outputs something quite different when substituted, but this illustrates the point.

Generally, templates should be transcluded and not substituted. Substitution does not preserve a reference to the template—it's like you didn't use a template at all. You lose the ability to have the content update automatically when you change the template.

Making Templates

For information on how to make templates, see Zelda Wiki:Making Templates.