|
|
(47 intermediate revisions by 14 users not shown) |
Line 1: |
Line 1: |
| {{HelpGuides}} | | {{HelpGuides}} |
| '''Templates''' are just that: templates that can be used on any page to standardize some element. There are many kinds of templates, each serving a different goal. | | :''See also: [https://www.mediawiki.org/wiki/Help:Templates Help:Templates on MediaWiki]'' |
|
| |
|
| Essentially, a template is a separate page, and by including the name of that page enclosed in <nowiki>{</nowiki>{two curly brackets}} in a page, the entire contents of that template page will be displayed on the page you've posted it on. Many templates have extra parameters that will form the actual content of the template.
| | 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}}. |
|
| |
|
| == Types of Templates ==
| | 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. |
| === Navigation Templates ===
| |
| :''See all [[:Category:Navigation Templates|navigation templates]]''
| |
| The simplest kind of template, navigation templates are simple templates that list several pages and facilitate page navigation. They are placed on pages of similar types, as can be seen with templates such as the {{[[Template:Songs|songs]]}} or {{[[Template:Fairies|fairies]]}} templates. These contain no extra parameters to modify.
| |
|
| |
|
| === Infobox 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]]. |
| :''See all [[:Category:Infobox Templates|infobox templates]]''
| |
| Infobox templates have specific fields relating to particular topics depending on what the infobox's intended purpose is, such as {{[[Template:Game|game]]}} or {{[[Template:System|system]]}}. These contain extra parameters to modify in order to display the necessary information.
| |
|
| |
|
| === Formatting Templates === | | ==Using Templates== |
| :''See all [[Help:Template List|formatting templates]]''
| | ===Parameters=== |
| Formatting templates exist to help with 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; it ensures that all in-game citations in references appear the same throughout the entire site. These contain extra parameters to modify.
| | Templates can have anonymous parameters, named parameters, or both. With anonymous parameters, order matters. |
|
| |
|
| == Making a Template ==
| | [[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. |
| The easiest way is to add '''<nowiki>{</nowiki>{your template name}}''' to the [[Zelda Wiki.org:Sandbox|Sandbox]], and click on the red link that appears. From there 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 at the end of the last line of the ACTUAL TEMPLATE 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. '''Do not''' finish the template, create a new line, and ''then'' add the <nowiki><noinclude></nowiki> tag.
| | [[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. |
| == Examples ==
| |
| {| class="wikitable" border="1" cellpadding="2"|-! | |
| !colspan=3| '''Notice Templates'''
| |
| |-
| |
| ! What to type !! What it's for !! What it makes
| |
| |-
| |
| |<pre>{{Accuracy}}</pre>
| |
| | Alert readers to disputed accuracy.
| |
| | <center><div class="messagebox" style="width: 33em; border: 1px solid #3b587e; background-color: #1f4973">
| |
| <div style="float: left;">[[File:Stop hand.png|40px| ]]</div>
| |
| <div style="margin-left: 50px;">'''The factual accuracy of this article or section is [[Accuracy dispute|disputed]].''' <br> Please see the relevant discussion on the article's {{Exist|{{NAMESPACE}} talk:{{PAGENAME}}|[[{{TALKSPACE}}:{{PAGENAME}}|talk page]]|talk page}}[[Category:Accuracy disputes|{{PAGENAME}}]].</div>
| |
| <div style="clear:left"></div></div></center> | |
| | |
| |-
| |
| |<pre>{{Ambig}}</pre>
| |
| | Alert readers to ambiguous canon status.
| |
| | ----
| |
| <font size=3 color="#dc51ff"><b>Ambiguously Canon Content!</b></font> '''''Be advised that the following article or section contains ambiguously canon content, which has been unconfirmed by Nintendo.'''''
| |
|
| |
|
| |-
| | ===Transclusion and substitution=== |
| |<pre>{{Archive}}</pre>
| | 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. |
| | Alert readers to read but not edit the archive.
| |
| | <div class="boilerplate metadata" id="stub" width=100% style="margin: 12px 0px;background-color: #1f4973; border: solid 1px #3b587e; padding: 5px;">
| |
| :<i>This page is an '''archive'''. The contents have been moved from another page for reference purposes only, and should be preserved in their current form. Discussion or voting on this page is '''not current'''. Please '''do not''' add new comments to this page because they probably won't be noticed by anyone. Instead, direct any comments to the '''[[{{#ifeq:||{{#ifeq:{{NAMESPACE}}||Talk:|{{SUBJECTSPACE}} talk:}}|{{{2}}}:}}{{#ifeq:||{{BASEPAGENAME}}|{{{1}}}}}|current talk page]]'''.</i>
| |
| </div>
| |
| |-
| |
| |<pre>{{Archives}}</pre>
| |
| | More like a nav template to get to archived versions. (Note: It floats to the left.)
| |
| | <div class="messagebox" style="width: 11em; border: 1px solid #3b587e; background-color: #1f4973; float: right; -moz-border-radius:20px;">
| |
| <div style="margin-left: 37px;"><div style="float: center;">[[File:Zwlogo2dlarge.png|60px]]</div></div> | |
| <div style="margin-left: 8px; margin-bottom: 8px;"><b> Archives:</b><small>
| |
| {{#switch:
| |
| |Other={{#ifeq:|{{Void}}|{{Void}}|*[[{{{2}}}{{!}}{{{3}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{4}}}{{!}}{{{5}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{6}}}{{!}}{{{7}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{8}}}{{!}}{{{9}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{10}}}{{!}}{{{11}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{12}}}{{!}}{{{13}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{14}}}{{!}}{{{15}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{16}}}{{!}}{{{17}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{18}}}{{!}}{{{19}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{20}}}{{!}}{{{21}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{22}}}{{!}}{{{23}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{24}}}{{!}}{{{25}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{26}}}{{!}}{{{27}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{28}}}{{!}}{{{29}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{30}}}{{!}}{{{31}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[{{{32}}}{{!}}{{{33}}}]]}}
| |
| |User={{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{2}}}{{!}}{{{2}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{3}}}{{!}}{{{3}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{4}}}{{!}}{{{4}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{5}}}{{!}}{{{5}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{6}}}{{!}}{{{6}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{7}}}{{!}}{{{7}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{8}}}{{!}}{{{8}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{9}}}{{!}}{{{9}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{10}}}{{!}}{{{10}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{11}}}{{!}}{{{11}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{12}}}{{!}}{{{12}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{13}}}{{!}}{{{13}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{14}}}{{!}}{{{14}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{15}}}{{!}}{{{15}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{16}}}{{!}}{{{16}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{17}}}{{!}}{{{17}}}]]}}
| |
| |User2={{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{2}}}{{!}}{{{3}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{4}}}{{!}}{{{5}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{6}}}{{!}}{{{7}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{8}}}{{!}}{{{9}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{10}}}{{!}}{{{11}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{12}}}{{!}}{{{13}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{14}}}{{!}}{{{15}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{16}}}{{!}}{{{17}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{18}}}{{!}}{{{19}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{20}}}{{!}}{{{21}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{22}}}{{!}}{{{23}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{24}}}{{!}}{{{25}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{26}}}{{!}}{{{27}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{28}}}{{!}}{{{29}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{30}}}{{!}}{{{31}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{32}}}{{!}}{{{33}}}]]}}
| |
| |#default={{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{2}}}{{!}}{{{3}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{4}}}{{!}}{{{5}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{6}}}{{!}}{{{7}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{8}}}{{!}}{{{9}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{10}}}{{!}}{{{11}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{12}}}{{!}}{{{13}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{14}}}{{!}}{{{15}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{16}}}{{!}}{{{17}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{18}}}{{!}}{{{19}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{20}}}{{!}}{{{21}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{22}}}{{!}}{{{23}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{24}}}{{!}}{{{25}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{26}}}{{!}}{{{27}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{28}}}{{!}}{{{29}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{30}}}{{!}}{{{31}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[User talk:{{PAGENAME}}/{{{32}}}{{!}}{{{33}}}]]}}
| |
| |Talk={{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{2}}}{{!}}{{{3}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{4}}}{{!}}{{{5}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{6}}}{{!}}{{{7}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{8}}}{{!}}{{{9}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{10}}}{{!}}{{{11}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{12}}}{{!}}{{{13}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{14}}}{{!}}{{{15}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{16}}}{{!}}{{{17}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{18}}}{{!}}{{{19}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{20}}}{{!}}{{{21}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{22}}}{{!}}{{{23}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{24}}}{{!}}{{{25}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{26}}}{{!}}{{{27}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{28}}}{{!}}{{{29}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{30}}}{{!}}{{{31}}}]]}}
| |
| {{#ifeq:|{{Void}}|{{Void}}|*[[Talk:{{PAGENAME}}/{{{32}}}{{!}}{{{33}}}]]}}}}
| |
| </small></div>
| |
| <div style="clear:right"></div></div>
| |
| |-
| |
| |<pre>{{Cleanup-date}}</pre>
| |
| | Alert editors to dirty articles?
| |
| |
| |
| {| cellspacing="3" align='center'
| |
| |- valign="top"
| |
| |width="100%" style="border: 1px solid #3b587e; background-color: #1f4973"|
| |
| <div style="padding: .4em .9em .9em"><center>'''To meet Zelda Wiki.org's [[Zelda Wiki.org:Quality Standards|quality standards]], this article or section may require [[Wikipedia:Cleanup|cleanup]].''' <br /><span style="font-size: 90%">
| |
| Please discuss this issue on the {{#ifexist::{{NAMESPACE}} talk:{{PAGENAMEE}}|<span class="plainlinks">[http://zeldawiki.org/{{TALKSPACEE}}:{{PAGENAMEE}} the article's talk page]</span>|talk page}}. [[Help:Contents|Editing help]] is available.<br />This article has been tagged since '''{{{1}}}'''.</span></center></div>
| |
| |}
| |
| [[Category:Articles needing attention]]
| |
|
| |
|
| | {| class="wikitable" |
| | |+ Transclusion vs. substitution after saving the page |
| | ! Input !! Output view !! Output source |
| |- | | |- |
| |<pre>{{Copyvio}}</pre> | | | <code><nowiki>{{MM}}</nowiki></code> || {{MM}} || <code><nowiki>{{MM}}</nowiki></code> |
| | Alert editors to potential copyright issues.
| |
| |
| |
| {| cellspacing="3" align="center"
| |
| |- valign="top"
| |
| |width="100%" class="MergeTemplate" style="border: 1px solid #3b587e; background-color: #1f4973"|
| |
| <div style="padding: .4em .9em .9em"> | |
| [[File:Warning.png|61px|left]]'''The content of this article may have been taken from another website, such as [[Wikipedia:Main Page|Wikipedia]], or is a [[Wikipedia:Copyvio|copyvio]].<br>Please rewrite or reformat this article completely to comply with Zelda Wiki.org's [[Zelda Wiki.org:Quality Standards|quality standards]].''' <br /><span style="font-size: 90%">Please discuss this issue on the {{#ifexist::{{NAMESPACE}} talk:{{PAGENAMEE}}|<span class="plainlinks">[http://zeldawiki.org/{{TALKSPACEE}}:{{PAGENAMEE}} the article's talk page]</span>|talk page}}. [[Help:Editing|Editing help]] is available.</span>
| |
| </div>
| |
| |}
| |
| [[Category:Articles needing attention]]
| |
| | |
| |- | | |- |
| |<pre>{{Copyvio}}</pre> | | | <code><nowiki>{{subst:MM}}</nowiki></code> || {{#switch:{{lc:{{{1}}}}} |
| | Alert editors to potential copyright issues. | | |- = ''Majora's Mask'' |
| | | | |himekawa = [[The Legend of Zelda: Majora's Mask (Himekawa)|''Majora's Mask'' {{#if:|(Himekawa)|manga}}]] {{#if:||by [[Akira Himekawa]]}} |
| {| cellspacing="3" align="center" | | |item = [[Majora's Mask (Item)|Majora's Mask]] |
| |- valign="top" | | |object = [[Majora's Mask (Item)|Majora's Mask]] |
| |width="100%" class="MergeTemplate" style="border: 1px solid #3b587e; background-color: #1f4973"| | | |#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 style="padding: .4em .9em .9em">
| |
| [[File:Warning.png|61px|left]]'''The content of this article may have been taken from another website, such as [[Wikipedia:Main Page|Wikipedia]], or is a [[Wikipedia:Copyvio|copyvio]].<br>Please rewrite or reformat this article completely to comply with Zelda Wiki.org's [[Zelda Wiki.org:Quality Standards|quality standards]].''' <br /><span style="font-size: 90%">Please discuss this issue on the {{#ifexist::{{NAMESPACE}} talk:{{PAGENAMEE}}|<span class="plainlinks">[http://zeldawiki.org/{{TALKSPACEE}}:{{PAGENAMEE}} the article's talk page]</span>|talk page}}. [[Help:Editing|Editing help]] is available.</span> | |
| </div> | |
| |} | | |} |
| [[Category:Articles needing attention]] | | {{Small|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]]. |