Naming convention, basic format and maintenance

edit
  • Template names should be of similar syntax i.e. no spaces, capitals, etc., and preferably use a mnemonic. All standardized template names should be prefixed uw-.
  • Templates will not include ==Headers==
  • Templates will not include ~~~~
  • All templates made obsolete are to have the relevant redirects added.
  • All templates should include a comment containing the template name in the format <!-- Template:templatename -->. For example, the {{uw-vandalism1}} template contains the comment <!-- Template:uw-vandalism1 -->. This is to assist counter-vandalism tools and bots in detecting and identifying user warning templates, and to be transparent to recipients.

Severity levels

edit

There are different severity levels for templates. All multi-level templates include several levels of increasing severity. The tone of these varies, from kindly, to very stern. These templates don't necessarily have to be followed in chronological order; a user may use any level of their choice; based on the severity desired. For example, the test series is test1, test2, test3, test4. The number of levels for any given template depends, on the editing actions in question.

Multi-level templates for vandalism

edit

There are 4 levels of template for editing actions that can be considered vandalism. For editing actions that can include severe or gross examples of vandalism, a level 4im template is also included in the template series.

  • Level 1 – A notice – Assumes good faith. Generally includes "Welcome to Wikipedia" or some variant.
  • Level 2 – Caution – No faith assumption; just a note.
  • Level 3 – Warning – Assumes bad faith; cease and desist. Generally includes "Please stop".
  • Level 4 – Final Warning – Assumes bad faith; strong cease and desist, last warning.
  • Level 4im – Only Warning – Assumes bad faith; very strong cease and desist, first and only warning. Generally used in the case of excessive or continuous disruption from a user or specific IP.

Multi-level templates for disruptive editing

edit

It is important to remember that disruptive editing is not vandalism. Although it may be appropriate to warn disruptive editors, it is not appropriate to report them as vandals at Administrator intervention against vandalism. Instead, you should consider the nature of the disruptive editing. If the edits relate to obvious disruption that is not properly defined as vandalism, it may be appropriate to report them to Administrators' noticeboard/Incidents. If the nature of the disruptive editing appears to be a content dispute, and an editor continues to engage in such edits, after a level 3 warning; consideration can be given to reporting the matter at a relevant noticeboard.

  • Level 1 – A notice – Assumes good faith. Generally includes "Welcome to Wikipedia" or some variant.
  • Level 2 – Caution – No faith assumption; just a note.
  • Level 3 – Warning – Assumes bad faith; cease and desist. Generally includes "Please stop" or "Stop".

Single issue notices

edit

The multi-level templates range from a polite pointer to the sandbox to a stern warning that the editor desist immediately or face consequences. There are also single issue notices that serve to remind other editors about minor mistakes. These generally cover common editing errors, such as not leaving an edit summary. These notices are not classed as warnings and the actions they advise against almost never result in a block.

Single issue warnings

edit

There are also single issue warnings. Single issue warnings generally serve to advise editors of policy breaches that; if repeated, are likely to result in a block. An example of such an act would be edit warring.

Civility and language

edit

Civility

edit

Regardless of the severity level of the template, any user warning should be a model of civility (even for the most destructive vandal). Remember that when you use a warning template, you may be seen to do so in Wikipedia's name.

Language

edit

With few exceptions user warnings should be written in English, but there are a few warning templates written in other languages. It is important that templates use language that is easily understood. Bear in mind that English Wikipedia attracts editors from all over the world; not everyone on English Wikipedia will speak English as a first language. When considering the wording of a template the following points should be observed:

  • Keep the message of the template 'on-track', avoid digression.
  • Try to keep sentences as concise as possible, see Wikipedia's manual of style for advice on writing style.
  • Level 1 and Level 2 templates and single issue notices should assume good faith. Beginning the message with "Welcome to Wikipedia" or "Hello" and ending with "Thank you" is considered appropriate.
  • Colloquialisms should be avoided in all templates.
  • The message should identify specific behavior. If possible, avoid "or" statements and other language that would not be used had the message been written out by a human.

Block advisories

edit
  • Generally speaking, block advisories should appear at the end of the template text.
  • It is appropriate to make reference to blocking in Level 3, Level 4 and Level 4im templates as well as in single issue warnings. Level 2 templates often include reference to the blocking policy but the wording is much less strong; for example, Level 2 templates often include text similar to "Continuing to edit disruptively could result in loss of editing privileges." Level 1 and single issue notices should not include reference to the blocking policy.
    • Level 3 templates often include a more direct reference to blocking, although, they should not include a bolded block warning. Typically Level 3 templates include: "Continuing to edit disruptively may result in you being blocked from editing." Or a variant thereof.
    • Level 4, Level 4im, and single issue warnings typically include text similar to: "If you continue to... you may be blocked from editing without further notice".
  • All references to blocking should include the use of the word "may" rather than "will" (be blocked from editing). This allows administrators to exercise discretion when dealing with complex cases of abuse.

Derivatives

edit

No derivative template (a non-standard variant of a template under a new name) should be included in the list of standardized templates or mentioned in the documentation. Although users are free to create and use non-standard templates, these should not be recognized in the standardized sets listed in these pages and should not be named using the uw- prefix.

Template coding guidelines

edit

Categorization

edit

Template page

edit

User warning templates should be categorized to Category:User warning templates (if the template is a redirect page to another template, it should be categorized using the sort key "Redirect"). User block templates should be categorized to Category:User block templates, with the sort key "Temporary" or "Indefinite" as appropriate. The category tag should be on the template page within noinclude syntax.

<noinclude>
[[Category:User templates]]
[[Category:User block templates|Indefinite]]
</noinclude>

User talk page

edit

Any template that places pages it's used on into a category should surround the category tags with the category parameter. If the template uses <noinclude> tags, be careful to place the parameter inside these tags. This allows the use of the template on a page (such as a talk or list page) without adding that page to a category by using the template with no value specified for the category parameter: {{template|category=}}.

<noinclude>{{{category|[[Category:User block templates|Temporary]]}}}</noinclude>

Parameters

edit

Default values

edit

Nearly every parameter should have a default value, such that misuse does not break the template. You can set the default value of a parameter by using piped syntax ({{{1|default value}}}). For example, the template below takes a parameter; it expects the user to supply a noun, but if they don't, it uses a default noun ("This").

{{{1|This}}} is cool.

Supplied with the noun {{template|Wikipedia}}, the template will expand to "Wikipedia is cool". {{template|This help page}} will expand to "This help page is cool". If the with {{template}}, the template will use the default value, and expand to "This is cool".

Named syntax

edit

When a template's parameters might be given symbols that break templates (notably the '|' pipe symbol and '=' equals sign), a named syntax should allow these. In such cases, a named and unnamed can coexist as needed. For example, a wikilink template can assign both a name and a number to a parameter by 'nesting' them (placing parameters in other parameters' default values).

[[{{{link|{{{1|<default value>}}}}}}]]

Using {{template|article}} is straightforward enough, and will expand to [[article]]. However, some symbols will break the template if used like that. These require the named syntax: {{template|link=article|name}}, which will expand to [[article|name]].

Nested substitution

edit

Any template containing templates, magic variables, or ParserFunctions should include a "safesubst:" parameter at the appropriate location. This allows for easy substitution of all nested templates inside a template. For example, consider the following template code:

This is {{{{{|safesubst:}}}CURRENTYEAR}}.

Substituting the template using {{subst:template}} will output "This is 2024".

Block template CSS

edit

Wikipedia allows registered users to maintain a personal stylesheet located at user:username/skin.css, where 'username' is the username and 'skin' is the name of the skin in use (usually monobook). To help users take full advantage of this feature, block templates should be enclosed in a CSS container with the "user-block" class.

<div class="user-block">template message</div>

Should the user wish to, they can customize the appearance of all block templates by adding CSS to their user stylesheet. For example, the following code adds a dark red background with white text.

.user-block { background:#C00 !important; color:#FFF; }

Compatibility with lists

edit

All user warning and block templates should be natively compatible with lists. For optimal intervention efficiency, talk pages with numerous warnings are sometimes organized into formatted lists sectioned by date (see the guidelines). Due to the way Wikipedia parses wiki syntax into HTML, list items are closed at any newline.

Templates with newlines will break any list they are placed in: the first paragraph will be in the list, the others out, and any subsequent templates in the list will begin a new list. By using HTML paragraph syntax directly, Wikipedia's paragraph parsing is circumvented and multiple-paragraph templates can then be added to organized warning lists without problem.

<p>Paragraph 1.</p><p>Paragraph 2.</p><p>Paragraph 3.</p>

To prevent the problem with newlines, templates must be on a single code line; however, this is highly illegible to humans in edit view. To restore legibility, HTML comments can be inserted to emulate the appearance of newlines. Although this looks ungainly with two-term lines, the comments are much less bulky when used with more realistic paragraphs.

<p>Paragraph 1.</p><!--
--><p>Paragraph 2.</p><!--
--><p>Paragraph 3.</p>