Help:Template

Related articles
Help:Editing
Help:Reading
Help:Style
A template is a piece of predefined
wikitext
that can be inserted into an article. Templates are primarily used to aid in formatting content.
Usage
Templates are used by adding the following markup to an article:
{{Template name}}
The general format is:
{{Template name|
parameter_1
|
parameter_2
|…|
parameter_N
}}
See
#List of templates
for specific usage instructions.
Most templates take additional arguments, such as
Template:Note
:
{{Note|This text should be noted.}}
which produces:
Note
This text should be noted.
Some templates can use named parameters, such as
Template:hc
:
{{hc|head=/etc/machine-id|output=0123456789abcdeffedcba9876543210}}
which produces:
/etc/machine-id
0123456789abcdeffedcba9876543210
Style
Templates must be used with
capitalization
shown in the examples on
their pages
—for example,
{{Pkg|…}}
and
{{ic|…}}
are correct, while
{{pkg|…}}
and
{{Ic|…}}
are not.
There must be
no spaces
around a template name—for example,
{{Template name|…}}
is correct, while
{{ Template name |…}}
is not.
Templates must not be categorized.
Escape template-breaking characters
There are some characters that, if used inside a template, will break its output: most frequently this happens with
=
(the equal sign) and
|
(the pipe sign). Solutions to this problem are described below.
Tip
The pipe symbol (
|
) can be escaped using the
{{!}}
magic word
.
The equal sign (
=
) can be escaped using the
{{=}}
magic word.
Named and numbered parameters
If the problem is only with
=
signs, the recommended solution is to explicitly introduce template parameters with their positional numbers or names.
Example:
{{Tip|1=https://archlinux.org/?foo=bar}}
Result:
Tip
https://archlinux.org/?foo=bar
This is very useful for:
variable definitions,
external links
with query strings in URLs,
shell strings and commands,
lines of code.
White space characters—e.g. newlines—are automatically stripped from the beginnings and ends of named parameter values. To preserve white space characters, start the parameter value with a
<nowiki/>
tag.
Example:
{{Tip|1=<nowiki/>
* https://archlinux.org/?foo=bar
* https://archlinux.org/?foo=baz
}}
Result:
Tip
https://archlinux.org/?foo=bar
https://archlinux.org/?foo=baz
Multiple parameters
Using positional parameters
1
and
2
.
Example:
{{hc|1=$ echo "="|2==}}
Result:
$ echo "="
=
Using named parameters
head
and
output
.
Example:
{{hc|head=$ echo "="|output==}}
Result:
$ echo "="
=
nowiki tags
If you are having problems with characters other than
=
—e.g.
}
—the recommended solution is to enclose the whole parameter in
<nowiki>
tags. This method displays all kinds of characters, but completely prevents the wiki engine from processing text markup, such as links and other templates.
Example:
{{Tip|<nowiki>= | }} https://archlinux.org/ {{ic|foo}}</nowiki>}}
Result:
Tip
= | }} https://archlinux.org/ {{ic|foo}}
Enclosing only specific parts (or even single characters) in
<nowiki>
tags still works of course, but for readability it is recommended to use such method only if links or other templates have to be normally displayed.
Example:
{{Tip|<nowiki>= | }}</nowiki> https://archlinux.org/ {{ic|foo}}}}
Result:
Tip
= | }}
https://archlinux.org/
foo
HTML entities
Replacing the offending characters with their respective HTML entities always works, but since it reduces the readability of the source text, it is recommended only when the solutions above are not practicable.
Example:
{{Tip|&#61; &#124; &#123;&#123; &#125;&#125;}}
Result:
Tip
= | {{ }}
List of templates
The templates that users can use directly in articles on the ArchWiki are listed below.
For a list that also includes
localization
and
meta
templates, see:
Special:AllPages/Template:
Special:PrefixIndex/Template:
Special:MostLinkedTemplates
.
Warning
Do not experiment with existing templates.
If you want to edit a non-protected template, copy the text to
Template:Sandbox
, edit and test it there, and copy it back when it works. See also
#Testing
.
It is strongly recommended—and is necessary for protected templates—to suggest any modifications on discussion pages first. See also
#Template creation
.
Code formatting
Template:ic
Template:bc
Template:hc
Template:Text art
Package
Template:Pkg
Template:Grp
Template:AUR
Note
Template:Note
Template:Tip
Template:Warning
For use in drafts on discussion pages only:
Template:Comment
Related articles
Template:Related articles start
Template:Related
Template:Related articles end
Status
These templates should be added at the beginning of concerning articles or sections. See also
Help:Style#Article status templates
.
Translators should also check template guidelines in
ArchWiki:Translation Team
.
The pages flagged with the article status templates are tracked in the corresponding
maintenance category
and in
ArchWiki:Statistics#Maintenance statistics
.
Name
Recommended use
Parameters
Template:Style
Content with language, wiki syntax or style issues.
1
— Reason.
2
— Optional talk page.
section
— Optional section in the default talk page.
Template:Accuracy
Incorrect or misleading content.
Template:Expansion
Incomplete content.
Template:Out of date
Outdated content.
Template:Remove
Irrelevant or unhelpful content.
Template:Archive
Obsolete pages.
Template:Laptop style
Laptop
pages not following the
Laptop page guidelines
.
Template:Translateme
Incomplete translations.
Template:Bad translation
Problematic translations.
Template:TranslationStatus
Status of translations.
1
— Original title.
2
— Translation date.
3
— Revision number.
Template:Merge
Content overlaps with another article.
1
— Target page.
2
— Reason.
3
— Optional talk page.
section
— Optional section in the default talk page.
Template:Move
Rename page, move section to another article.
Template:Redirect
Redirect page to another article.
Template:Unsupported
User pages unsupported by Arch Linux.
1
— Date of last review by page author.
Table header
Template:Docks table header
Template:Laptops table header
Table cell
Tip
You can use attributes with table cell templates by prefixing them, e.g:
| colspan=2 {{Yes}}
.
Text align
Name
Align
Wiki markup
Result
Template:C
Center
{{C|Text}}
Text
Template:L
Left
{{L|Text}}
Text
Cell background
Name
Color
Wiki markup
Result
Template:R
Red
{{R|Text}}
Text
Template:O
Orange
{{O|Text}}
Text
Template:Y
Yellow
{{Y|Text}}
Text
Template:G
Green
{{G|Text}}
Text
Template:B
Blue
{{B|Text}}
Text
Template:V
Violet
{{V|Text}}
Text
Template:Grey
Grey
{{Grey|Text}}
Text
Common text
Name
Wiki markup
Result
Template:Yes
{{Yes}}
Yes
{{Yes|https://wiki.archlinux.org/}}
Yes
Template:No
{{No}}
No
{{No|https://wiki.archlinux.org/}}
No
Template:-
{{-}}
–
Category
Template:Cat main
Navigation
Template:Laptops navigation
Template:List of applications navigation
Template:Package guidelines
Link
Template:Bug
Template:Issue
Template:man
Maintenance
Template:AR
Template:Archived page
Template:Broken package link
Template:Broken section link
Template:Dead link
Template:Editsum
Template:Hidden category
Template:Notice
Template:Unsigned
Meta
These templates should only be transcluded from other templates.
Template:META Error
Template:META Message
Template:META Missing package
Template:META Related articles start
Template:META Unexplained Status Template
Template:Template
Miscellaneous
Template:App
Template:Committed identity
Template:Lowercase title
Template:Progressbar
Testing
Template:Sandbox
Template:Lorem Ipsum
Template creation
Note
Before creating a template, discuss the idea in
Help talk:Template
.
The Template namespace is
semi-protected
. Only
autoconfirmed users
can create or edit templates.
Only create
relevant templates
—if you are attempting to create a very specialized template that will likely only ever be used on a few articles, please do not bother, avoid cluttering up the templates namespace.
Only create
concise templates
—remember
The Arch Way
and
Keep It Simple, Stupid!
The following template should be used when creating new templates to facilitate usage and editing:
<noinclude>
{{Template}}

A brief description of the template

== Usage ==

 <nowiki>{{Template name|param1|param2|...|paramN}}</nowiki>

== Example ==

{{Template name|param1|param2|...|paramN}}</noinclude><includeonly>Template code goes here...</includeonly>
To begin the creation process, simply visit
Template:Template name
(substituting
Template name
with the desired name of the template),
edit, and add the relevant wikitext
.
See also
MediaWikiWiki:Help:Templates