Difference between revisions of "Help:Templates"

From Nookipedia, the Animal Crossing wiki
m (Text replacement - "{{nookipedia}}" to "{{Navbox Nookipedia}}")
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{Help}}
 
{{Help}}
This article is all about using templates on Nookipedia. It will teach you how to add and use templates in articles.  
+
This article is all about using '''templates on Nookipedia'''. It will teach you how to add and use templates in articles.  
  
 
==What is a template?==
 
==What is a template?==
A template allows information stored on one page of the wiki to be displayed on another page. This process is called transclusion and is signaled by a template tag – a string surrounded by two braces on either side (e.g. <tt><nowiki>{{roundy}}</nowiki></tt>).
+
A template allows information stored on one page of the wiki to be displayed on another page. This process is called transclusion and is signaled by a template tag – a string surrounded by two braces on either side (e.g. {{t|roundy}}).
  
 
====Why do we use templates?====
 
====Why do we use templates?====
Templates function as a sort of shorthand so that long or frequently used strings of text, HTML and/or CSS code do not need to be typed repeatedly. They are often used when information needs to be organized consistently across multiple pages, usually in the form of tables, lists, or other containers of information. They can also be used to more quickly apply formatting to text (e.g. <tt><nowiki>{{PG}}</nowiki></tt> produces {{PG}}), or to automatically add articles to categories.
+
Templates function as a sort of shorthand so that long or frequently used strings of text, HTML and/or CSS code do not need to be typed repeatedly. They are often used when information needs to be organized consistently across multiple pages, usually in the form of tables, lists, or other containers of information. They can also be used to more quickly apply formatting to text (e.g. {{t|PG}} produces {{PG}}), or to automatically add articles to categories.
  
 
====How do I use templates?====
 
====How do I use templates?====
To use a template it must be correctly called using the template tag. First, determine the template to be called. To search for a template, type "Template:" in the search bar. All templates contain this identifier, and it is an optional component of a template tag (e.g. both <tt><nowiki>{{Template:roundy}}</nowiki></tt> and <tt><nowiki>{{roundy}}</nowiki></tt> are valid template calls). Once you've determined which template to use, place brackets <tt>{{ }}</tt> on either side of the template name. If the template is not transcluded onto the page, and instead you receive something like this – {{test}}, a link to a template that doesn't exist, then the template name you used is incorrect. A major advantage to using templates is that they can be updated, and these changes will take effect immediately on any page the template appears on.
+
To use a template it must be correctly called using the template tag. First, determine the template to be called. To search for a template, type "Template:" in the search bar, check the list of [https://nookipedia.com/wiki/Special:PrefixIndex?prefix=&namespace=10 all Nookipedia templates], or search for a [[:Category:Templates|template by category]]. All templates contain the "Template:" identifier, and it is an optional component of a template tag (e.g. both {{[[Template:roundy]]}} and {{t|roundy}} are valid template calls).
 +
 
 +
Once you've determined which template to use, place brackets <code>{{ }}</code> on either side of the template name. If the template is not transcluded onto the page, and instead you receive something like this – {{test}}, a link to a template that doesn't exist, then the template name you used is incorrect (check caps and spaces). A major advantage to using templates is that they can be updated, and these changes will take effect immediately on any page the template appears on. (If it doesn't, try purging the page's cache by clicking edit on the page and then replacing "&action=edit" at the end of the URL with "&action=purge" and pressing enter.)
  
 
==Creating templates==
 
==Creating templates==
Line 17: Line 19:
  
 
Extensive information on template creation can be found in the [[Help:Templates#Resources|Resources]] section at the bottom of the page.
 
Extensive information on template creation can be found in the [[Help:Templates#Resources|Resources]] section at the bottom of the page.
 +
 +
==Template documentation==
 +
Whenever a new template is created, documentation on how to use it should also be provided. This documentation should explain its main features, give example use-cases, and note any parameters required for the template to function correctly. Each template author may choose their own documentation style, whether that is creating a [[Template:Calendar/doc|separate documentation page]], or placing the documentation [[Template:A-card|directly into the template page]].
 +
 +
To make sure only the template code is transcluded when the template is called (and not the associated documentation), you can use <code><nowiki><noinclude></nowiki></code> or <code><nowiki><onlyinclude></nowiki></code> to perform a partial transclusion. More information is available at [[wikipedia:Wikipedia:Transclusion|Wikipedia:Transclusion]]. The HTML <code><nowiki><pre></nowiki></code> tag may be helpful to generate template usage examples, or you can selectively control wikicode function using <code><nowiki><nowiki></nowiki></code> around code you don't want to function (and therefore remain visible to readers). The [[Template:T|<nowiki>{{t}}</nowiki> template]] is helpful when linking to other templates that may be related to the template you've created.
  
 
==Types of templates==
 
==Types of templates==
 
===Navigation templates===
 
===Navigation templates===
 
:''See all [[:Category:Navbox_templates|navigation templates]]''
 
:''See all [[:Category:Navbox_templates|navigation templates]]''
Also known as navbox templates, these simple templates group links of related pages together and facilitate navigation. They are placed on pages which share a similar theme or feature similar content, as is the case with the {{[[Template:Animal Crossing|Animal Crossing]]}} or {{[[Template:Dog|Dog]]}} templates. Navbox templates do not generally accept parameters.
+
Also known as navbox templates, these simple templates group links of related pages together and facilitate navigation. They are placed on pages which share a similar theme or feature similar content, as is the case with the {{t|Animal Crossing}} or {{t|Dog}} templates. Navbox templates do not generally accept parameters.
  
 
===Infobox templates===
 
===Infobox templates===
Line 28: Line 35:
  
 
===Notice templates===
 
===Notice templates===
:''See all [[:Category:Notice Templates|notice templates]]
+
:''See all [[:Category:Notice templates|notice templates]]
 
Notice templates are placed in articles to provide users information about a page's condition. Some contain parameters for users to fill in to customize the information displayed..
 
Notice templates are placed in articles to provide users information about a page's condition. Some contain parameters for users to fill in to customize the information displayed..
  
Line 40: Line 47:
 
===Linking to game pages===
 
===Linking to game pages===
 
:''See also: [[:Category:Link templates]]''
 
:''See also: [[:Category:Link templates]]''
 
 
We have templates that create properly formatted links to each Animal Crossing game (spinoffs included).
 
We have templates that create properly formatted links to each Animal Crossing game (spinoffs included).
  
Line 49: Line 55:
 
| →
 
| →
 
| {{SER}}
 
| {{SER}}
|-
 
|
 
|-
 
|
 
 
|-
 
|-
 
| style="text-align:right" | <tt><nowiki>{{DnM}}</nowiki></tt>
 
| style="text-align:right" | <tt><nowiki>{{DnM}}</nowiki></tt>
 
| →
 
| →
 
| {{DnM}}
 
| {{DnM}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{DnM+}}</nowiki></tt>
 +
| →
 +
| {{DnM+}}
 
|-
 
|-
 
| style="text-align:right" | <tt><nowiki>{{PG}}</nowiki></tt>
 
| style="text-align:right" | <tt><nowiki>{{PG}}</nowiki></tt>
Line 66: Line 72:
 
| {{DnMe+}}
 
| {{DnMe+}}
 
|-
 
|-
| style="text-align:right" | <tt><nowiki>{{CF}}</nowiki></tt>
+
| style="text-align:right" | <tt><nowiki>{{iQue}}</nowiki></tt>
 
| →
 
| →
| {{CF}}
+
| {{iQue}}
 
|-
 
|-
 
| style="text-align:right" | <tt><nowiki>{{WW}}</nowiki></tt>
 
| style="text-align:right" | <tt><nowiki>{{WW}}</nowiki></tt>
 
| →
 
| →
 
| {{WW}}
 
| {{WW}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{CF}}</nowiki></tt>
 +
| →
 +
| {{CF}}
 
|-
 
|-
 
| style="text-align:right" | <tt><nowiki>{{NL}}</nowiki></tt>
 
| style="text-align:right" | <tt><nowiki>{{NL}}</nowiki></tt>
Line 78: Line 88:
 
| {{NL}}
 
| {{NL}}
 
|-
 
|-
! colspan=3, style="text-align:center" | <br>Spinoff titles
+
| style="text-align:right" | <tt><nowiki>{{NLWa}}</nowiki></tt>
 +
| →
 +
| {{NLWa}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{NH}}</nowiki></tt>
 +
| →
 +
| {{NH}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{HHP}}</nowiki></tt>
 +
| →
 +
| {{HHP}}
 +
|-
 +
! colspan=3, style="text-align:center; padding: 10px 0 0 0" | Spinoff titles
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{AI}}</nowiki></tt>
 +
| →
 +
| {{AI}}
 
|-
 
|-
 
| style="text-align:right" | <tt><nowiki>{{SD}}</nowiki></tt>
 
| style="text-align:right" | <tt><nowiki>{{SD}}</nowiki></tt>
Line 88: Line 114:
 
| {{HHD}}
 
| {{HHD}}
 
|-
 
|-
| style="text-align:right" | <tt><nowiki>{{AMF}}</nowiki></tt>
+
| style="text-align:right" | <tt><nowiki>{{aF}}</nowiki></tt>
 +
| →
 +
| {{aF}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{PC}}</nowiki></tt>
 +
| →
 +
| {{PC}}
 +
|-
 +
! colspan=3, style="text-align:center; padding: 10px 0 0 0" | ''Super Smash Bros.'' series
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{SSBM}}</nowiki></tt>
 +
| →
 +
| {{SSBM}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{SSBB}}</nowiki></tt>
 +
| →
 +
| {{SSBB}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{SSB4}}</nowiki></tt>
 
| →
 
| →
| {{AMF}}
+
| {{SSB4}}
 
|-
 
|-
! colspan=3, style="text-align:center" | <br>Other media
+
| style="text-align:right" | <tt><nowiki>{{SSB4|3ds}}</nowiki></tt>
 +
| →
 +
| {{SSB4|3ds}}
 
|-
 
|-
| style="text-align:right" | <tt><nowiki>{{AM}}</nowiki></tt>
+
| style="text-align:right" | <tt><nowiki>{{SSB4|wiiu}}</nowiki></tt>
 
| →
 
| →
| {{AM}}
+
| {{SSB4|wiiu}}
 
|-
 
|-
|
+
| style="text-align:right" | <tt><nowiki>{{SSB4|3dswiiu}}</nowiki></tt>
 +
| →
 +
| {{SSB4|3dswiiu}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{SSBU}}</nowiki></tt>
 +
| →
 +
| {{SSBU}}
 +
|-
 +
! colspan=3, style="text-align:center; padding: 10px 0 0 0" | Other media
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{Film}}</nowiki></tt>
 +
| →
 +
| {{Film}}
 +
|-
 +
| style="text-align:right" | <tt><nowiki>{{HMD}}</nowiki></tt>
 +
| →
 +
| {{HMD}}
 
|}
 
|}
  
Line 164: Line 226:
  
 
===Other notable templates===
 
===Other notable templates===
{|
 
| style="text-align:right" | <tt><nowiki>{{f}}</nowiki></tt>
 
| →
 
| {{f}}
 
|}
 
*Creates a link to the forums.
 
 
{|
 
{|
 
|-
 
|-
Line 200: Line 256:
  
 
==Resources==
 
==Resources==
*[http://meta.wikimedia.org/wiki/Help:Template Help:Template] - General help for template creation.
+
* [[wikipedia:Wikipedia:Transclusion|Wikipedia:Transclusion]]
*[http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Help:Extension:ParserFunctions] - Help for Parser Functions, a wiki extension that allows for more complex coding functions.
+
* [http://meta.wikimedia.org/wiki/Help:Template Help:Template] - General help for template creation.
 +
* [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions Help:Extension:ParserFunctions] - Help for Parser Functions, a wiki extension that allows for more complex coding functions.
 
<br clear=all>
 
<br clear=all>
{{nookipedia}}
+
{{Navbox Nookipedia}}
 
[[Category:Help]]
 
[[Category:Help]]

Latest revision as of 10:35, February 13, 2023

This article is all about using templates on Nookipedia. It will teach you how to add and use templates in articles.

What is a template?[edit]

A template allows information stored on one page of the wiki to be displayed on another page. This process is called transclusion and is signaled by a template tag – a string surrounded by two braces on either side (e.g. {{roundy}}).

Why do we use templates?[edit]

Templates function as a sort of shorthand so that long or frequently used strings of text, HTML and/or CSS code do not need to be typed repeatedly. They are often used when information needs to be organized consistently across multiple pages, usually in the form of tables, lists, or other containers of information. They can also be used to more quickly apply formatting to text (e.g. {{PG}} produces Animal Crossing), or to automatically add articles to categories.

How do I use templates?[edit]

To use a template it must be correctly called using the template tag. First, determine the template to be called. To search for a template, type "Template:" in the search bar, check the list of all Nookipedia templates, or search for a template by category. All templates contain the "Template:" identifier, and it is an optional component of a template tag (e.g. both {{Template:roundy}} and {{roundy}} are valid template calls).

Once you've determined which template to use, place brackets {{ }} on either side of the template name. If the template is not transcluded onto the page, and instead you receive something like this – Template:Test, a link to a template that doesn't exist, then the template name you used is incorrect (check caps and spaces). A major advantage to using templates is that they can be updated, and these changes will take effect immediately on any page the template appears on. (If it doesn't, try purging the page's cache by clicking edit on the page and then replacing "&action=edit" at the end of the URL with "&action=purge" and pressing enter.)

Creating templates[edit]

Template pages are created the same way any other page is created. Begin by typing in your desired template name into the search bar preceded by the word "Template:". All templates must start with this identifier in order to function as a template instead of an article page. If the template does not already exist, click the link provided to create the new page.

The template's code should be typed into the wikitext editor. Remember that anything you type here will be "cut and pasted" into another page whenever this template is called. For example, if you create a template with the name {{test}} and put "This is a test." on the template page, whenever someone calls {{test}} it will produce "This is a test." on the page. Just like any other page on the wiki, templates can take advantage of HTML and CSS code allowing them to perform complex functions.

Extensive information on template creation can be found in the Resources section at the bottom of the page.

Template documentation[edit]

Whenever a new template is created, documentation on how to use it should also be provided. This documentation should explain its main features, give example use-cases, and note any parameters required for the template to function correctly. Each template author may choose their own documentation style, whether that is creating a separate documentation page, or placing the documentation directly into the template page.

To make sure only the template code is transcluded when the template is called (and not the associated documentation), you can use <noinclude> or <onlyinclude> to perform a partial transclusion. More information is available at Wikipedia:Transclusion. The HTML <pre> tag may be helpful to generate template usage examples, or you can selectively control wikicode function using <nowiki> around code you don't want to function (and therefore remain visible to readers). The {{t}} template is helpful when linking to other templates that may be related to the template you've created.

Types of templates[edit]

Navigation templates[edit]

See all navigation templates

Also known as navbox templates, these simple templates group links of related pages together and facilitate navigation. They are placed on pages which share a similar theme or feature similar content, as is the case with the {{Animal Crossing}} or {{Dog}} templates. Navbox templates do not generally accept parameters.

Infobox templates[edit]

See all infobox templates

Infobox templates generate information containers with fields relevant to a particular topic, such as Template:Infobox Species. These templates contain modifiable parameters in order to display the necessary information.

Notice templates[edit]

See all notice templates

Notice templates are placed in articles to provide users information about a page's condition. Some contain parameters for users to fill in to customize the information displayed..

Userbox templates[edit]

See all userboxes

Userboxes are fun profile templates for your userpage. They are quick and attractive ways to tell others about yourself.

Common Nookipedia templates[edit]

The following lists give examples of some of the more commonly used templates on the wiki.

Linking to game pages[edit]

See also: Category:Link templates

We have templates that create properly formatted links to each Animal Crossing game (spinoffs included).

Main series titles
{{SER}} Animal Crossing series
{{DnM}} Doubutsu no Mori
{{DnM+}} Doubutsu no Mori+
{{PG}} Animal Crossing
{{DnMe+}} Doubutsu no Mori e+
{{iQue}} Dòngwù Sēnlín
{{WW}} Animal Crossing: Wild World
{{CF}} Animal Crossing: City Folk
{{NL}} Animal Crossing: New Leaf
{{NLWa}} Animal Crossing: New Leaf - Welcome amiibo
{{NH}} Animal Crossing: New Horizons
{{HHP}} Animal Crossing: New Horizons – Happy Home Paradise
Spinoff titles
{{AI}} Animal Island
{{SD}} Animal Crossing: Sweet Day
{{HHD}} Animal Crossing: Happy Home Designer
{{aF}} Animal Crossing: amiibo Festival
{{PC}} Animal Crossing: Pocket Camp
Super Smash Bros. series
{{SSBM}} Super Smash Bros. Melee
{{SSBB}} Super Smash Bros. Brawl
{{SSB4}} Super Smash Bros. 4
{{SSB4|3ds}} Super Smash Bros. for Nintendo 3DS
{{SSB4|wiiu}} Super Smash Bros. for Wii U
{{SSB4|3dswiiu}} Super Smash Bros. for Nintendo 3DS / Wii U
{{SSBU}} Super Smash Bros. Ultimate
Other media
{{Film}} 🎬 Gekijōban Doubutsu no Mori
{{HMD}} Doubutsu no Mori: Hohinda Mura Dayori

Page formatting[edit]

These templates are used to format text or change the way elements on the page are arranged.

{{main|Help:Contents}}
Main article: Help:Contents
  • Used in article subsections to link to a subject's main article that contains more detailed information.
{{wrongpage|Templates|any other kind of plate|Tom Nook's store}}
This article is about Templates. For any other kind of plate, see Tom Nook's store.
  • Used at the top of an article to direct readers to pages with a similar title.
{{clear}} No visual manifestation.
  • This template makes sure that different elements on the page don't get in each other's way. If an image or other block-level element would overlap one another, this template will preserve the space in between them.
{{quote|Promises are like pie crusts - they're made to be broken.|Pecan|{{NL}}}}
"Promises are like pie crusts - they're made to be broken."
— Pecan, Animal Crossing: New Leaf
  • Used to quote characters. Quote comes first, then who said it, finally the game they said it in.
{{roundy}}
Example
  • Inserted as a CSS style to make elements rounded. Almost all the elements that have rounded corners on Nookipedia are created using this template. Can also be applied to one side (e.g. roundyright) or one corner (e.g. roundybr).

Other notable templates[edit]

{{(!}} {|
{{!)}} |}
{{!}} |
{{!-}} |-
{{=}} =
  • Used in templates when trying to insert tables or CSS formatting into parser functions.

Resources[edit]