Help:Templates

From The Reed and Rite
Table of Contents
Contents | Introduction | Guidelines | Markup | References | Images | Categories | Templates | What's Next?

Introduction

Templates are standard wiki pages whose content is designed to be transcluded (embedded) inside other pages. They enable a user to simplify complex and repetitive processes. You embed this content into other pages through the use of a coded tag. In this article we'll go over the basics of using templates, some useful templates that are already available, and an introduction to creating your own templates. For a more in depth guide on templates, check out Mediawiki's Help article.

Basics of Templates

Templates use coded tags which are easy to recognize as they are enclosed by double curly braces. ({{ and }}) To use one you must first indicate the name of the template you want to use, and then define various parameters. All of the elements between the double curly braces are separated by vertical bars. (|) The number and type of parameters will vary depending on the template.

Some templates will be written in a single line of text, but some may span multiple lines. The more complex it is, the more likely it is to span multiple lines—this is to help with clarity in usage. For example:

A Single Line Template A Multi-Line Template
{{template name|parameter1|parameter2|parameter3}}
{{template name
|parameter1
|parameter2
|parameter3
}}

Parameters

Parameters come in two varieties: Named and Unnamed (also sometimes called "Anonymous"). Templates will use one or the other, or sometimes even both. You can see the exact parameters a template uses by checking out its template page.

Named Parameters
Named parameters can be recognized by their use of an equals sign (=), which is required with a named parameter. The equals sign is followed by your input. For example:
{{template name|parameter1=INPUT}}
In this example parameter1= is a named parameter because of its use of an equals sign. INPUT would be replaced by your input.
Unnamed Parameters
Unnamed parameters should be completely replaced by your input. For example:
{{template name|INPUT}}
In this example INPUT is an unnamed parameter, and would be replaced by your input. Note that no other text is required beyond your input.

Parameter Examples

Let's take a look at some templates in action.

Example: Named Parameters
This example demonstrates a {{Character}} infobox template, which uses named parameters. Note that the name of the template comes first. ("{{character"), followed by the named parameters.
You Type You Get
{{character
|name=Beth Brower
|image=Beth Brower-2.jpg
|caption=Our Undaunted Author
|profession=Author, Owner of Cat
|titles=''The Right Honorable Beth''
}}
Beth Brower
Our Undaunted Author
Our Undaunted Author
Our Undaunted Author
ProfessionAuthor, Owner of Cat
TitlesThe Right Honorable Beth


Example: Unnamed Parameters
This example demonstrates a {{Quote}} template, which uses unnamed parameters.
You Type You Get
{{quote|My existence of the last three years has been nothing but incident.|Emma M. Lion}}

My existence of the last three years has been nothing but incident.

—Emma M. Lion


Example: Mix of Parameters
This example demonstrates an {{Image}} template, which uses a mix of named and unnamed parameters.
You Type You Get
{{image|Pen.png|A pen nib silhouette.|align=left|width=200px}}
A pen nib silhouette.

Types of Templates

Next we'll go over the most common templates you will encounter. The explanations below give only a brief description of their function. To learn how to use or implement a particular template into the content of an article, please visit the linked templates page:

Information Boxes

Information boxes, or as they're more commonly known, Infoboxes, are templates that add a table of basic information related to the subject of that page to the top right of the page. There are infoboxes for each of the main content categories (e.g., {{book}}, {{character}}, {{location}}), but there are a few other more specialized ones.

Navigation Boxes

Navigation boxes, also called navboxes, are templates that create a table of links related to the book/series of that page. Navboxes are placed in the Notes section of articles, between the <references /> tag and any quality tags.

Notices

Notice templates are used to alert users and editors of important information. The table below gives a brief description of a few notices:

Template Description
{{urgent}} Adds a red quill indicator icon (An red quill icon.) to the top right of a page and adds the article to the category Category:Articles in Need of Attention. Place directly after the infobox.
{{spoiler}} Warns that an article or section contains information pertaining to recently published material that many users may not have read yet. Place directly after infobox or at the top of the relevant section..
{{claim}} Warns other users that a page or section has been claimed for editing and asks that they collaborate with that user before making any edits. Place at the top of the page, after the infobox (if present), or at the top of the claimed section.
{{copyright}} Notifies users that a page or section contains copyrighted material that is used with permission and to warn them against reusing it.
{{theory}} Warns that the article or section contains speculation and should not be considered canon. Place directly after infobox or directly after section heading.
{{delete}} Requests that an administrator delete the page.
{{rename}} Requests that an administrator rename the page. An unnamed parameter may be included to indicate the new proposed name.
Quality Tags Quality tags are simple templates that indicate the level of completion/quality of an article and categorize it accordingly. These are discussed in detail on the Help:Categories page and include {{stub}}, {{partial}}, and {{complete}}

Reference Templates

Reference Templates are used to create footnotes and references in an article. Wherever the template is used, a superscripted number is added that links to the full reference in the "Notes" section. Additionally, hovering over the superscripted number for a brief second will trigger a popup window where one can also see the linked footnote without having to click the link.

Editorial Notations

Editorial Notations are used to highlight statements in articles that may need attention. This typically is applied to information that is unsupported, ambiguous, or questionable.

Other Templates

For more details on each templates usage, see the linked template page.

Some other notable templates include the following:

Template Description
{{columns}} The {{columns}} template is used to create a list of items that spans the width of the page instead of creating a line break between each item in the list. The default number of columns is three, but can be customized to any number the user wishes.
{{quote}} The {{quote}} template creates a stylized quote block. Users have the option to add a reference to the source. The default width of the quote block is 100%, but there are optional parameters to define width and alignment to allow a user to insert quotes in blocks of text.
{{for}} Use the {{for}} template to provide a link to a related topic or page. The output of this template is "For________, see [LINK]". You can see this template in use several times on this very page.
{{b}} The {{b}} template converts an abbreviated reference into a full book or series title. (e.g., Writing "{{b|e1}}" will output: "The Unselected Journals of Emma M. Lion: Volume 1".) Thereby simplifying and speeding up the process of including full titles in articles.

Editing Templates

Creating and editing templates is quite an advanced topic. For extensive instructions on building templates, check out MediaWiki's Help Manual. Feel free to make use of the {{test}} template to experiment with edits to existing templates or in creating new ones.


Categories Templates What's Next?