Help:Templates: Difference between revisions

From The Reed and Rite
Line 109: Line 109:
|-
|-
| style="text-align: center;" | {{t|urgent}}  
| style="text-align: center;" | {{t|urgent}}  
| Makes note at top of page that article needs attention and categorizes the article accordingly. Place directly after infobox. (<span style="color: red; font-size: 130%;">&#x2691;</span>)
| Adds a red quill indicator icon ([[File:Quill-red.png|20px|link=|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 infobox.
|-
|-
| style="text-align: center;" | {{t|copyright}}  
| style="text-align: center;" | {{t|copyright}}  

Revision as of 19:49, 27 March 2025

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}} 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.|artist=Declan Lion|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 infobox.
{{copyright}} Asks users not to copy the content on the article.
{{theory}} Warns that the article or section contains speculation and should not be considered canon. Place directly after infobox or directly after section heading.
{{spoilers}} Warns that the article contains information pertaining to recently published material that many users may not have read yet. Place directly after infobox.
{{delete}} Requests that an administrator delete the page.
{{move}} Requests that an administrator move the page (change the title). An unnamed parameter may be included to indicate which page it should be moved to.
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.

Editing Templates

Editing templates is an advanced topic and is not for the faint of heart. But if you remain undaunted, you can learn more on the Templates Subpage.


Categories Templates What's Next?