Difference between revisions of "Help:Templates"

From Nookipedia, the Animal Crossing wiki
(Completely revamped page, included resource links.)
Line 2: Line 2:
 
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.  
  
==Types of Templates==
+
==What is a template?==
===Navigation Templates===
+
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>).
 +
 
 +
====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.
 +
 
 +
====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.
 +
 
 +
==Types of templates==
 +
===Navigation templates===
 
:''See all [[:Category:Navbox_templates|navbox templates]]''
 
:''See all [[:Category:Navbox_templates|navbox templates]]''
The simplest kind of template, navigation templates, also known as navbox 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:Animal Crossing|Animal Crossing]]}} or {{[[Template:Dog|Dog]]}} templates. These contain no extra parameters to modify.
+
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.
  
===Infobox Templates===
+
===Infobox templates===
 
:''See all [[:Category:Infobox templates|infobox 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:Infobox Species]]. These contain extra parameters to modify in order to display the necessary information.
+
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===
+
===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 the page and its condition. Some contain parameters for users to fill in.
+
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===
+
===Userbox templates===
 
:''See all [[:Nookipedia:Userboxes|userboxes]]''
 
:''See all [[:Nookipedia:Userboxes|userboxes]]''
Userboxes are fun profile templates for your userpage. They are quick and attractive ways to tell things about you.
+
Userboxes are fun profile templates for your userpage. They are quick and attractive ways to tell others about yourself.
 
 
==What is a template?==
 
 
 
A template is a CSS/HTML code which has been saved in a manner so that you don't have to type it out every time you want to add it to an article. Take the Help Navigation Box. It is a custom modified navigation box template. Although the natural template has a red color, the help box has been changed to blue. Some templates also add articles to categories so you don't need to write the code for that.
 
Adding and Using Templates
 
  
Most site/high traffic related templates are protected for admin editing so that they don't get vandalised, but all userboxes are not protected so anyone can add them to their profile. To add a template you can just add <nowiki>{{ and }}</nowiki> around a template name such as the roundy template. The template will automatically show up (to the latest incarnation of it anyway) to the users.
+
==Creating templates==
 +
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.
  
==Userboxes?==
+
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 <nowiki>{{test}}</nowiki> and put "This is a test." on the template page, whenever someone calls <nowiki>{{test}}</nowiki> 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.
  
Userboxes are boxes that have been made by modifying the userbox template. You can create your own and add it to your profile and then to category for others to do the same.
+
Extensive information on template creation can be found in the Resources links below.
  
 +
==Resources==
 +
*[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>
 
{{nookipedia}}
 
{{nookipedia}}
 
[[Category:Help]]
 
[[Category:Help]]

Revision as of 11:22, October 16, 2014

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?

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?

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?

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 {{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. 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.

Types of templates

Navigation templates

See all navbox 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

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

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

See all userboxes

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

Creating templates

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 links below.

Resources