Jump to content

Template:Article for deletion/switch

From Elite Dangerous Wiki
Revision as of 20:55, 10 September 2026 by Wikipedia>Chaotic Enby (+safesubst)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit "Template:Article for deletion/switch/doc" to edit its documentation if it is available. (How does this work?)

This is a small helper template used internally by {{AfD/dated}} (and related deletion-process templates) to pick one of four pieces of text depending on the action being sought in the nomination: merging, redirecting, draftifying, or (by default) deletion. It is not meant to be used on its own outside of these templates.

Usage

{{Article for deletion/switch|VALUE|merge-text|redirect-text|draftify-text|default-text}}

The template takes five unnamed (positional) parameters:

  1. The value to test, normally |action= passed through from {{Afd}}.
  2. The text to return if parameter 1 is merge or merging.
  3. The text to return if parameter 1 is redirect or redirecting.
  4. The text to return if parameter 1 is draft, draftify, draftifying, or draftification.
  5. The default text, returned for any other value, including a blank value, delete, or deletion. Most often used for deletion.

In other words, the template is a thin wrapper around a #switch parser function, matching parameter 1 against a small set of recognised outcome keywords and falling through to the default text (parameter 5) when nothing matches. This is what lets {{Afd}} show wording appropriate to the process actually being requested, without repeating four near-identical passages of prose throughout its code.

Example

Inside {{Afd}}, the switch is called several times, for example to choose the icon shown in the message box:

{{Article for deletion/switch|{{{outcome|}}}|[[File:Merge-arrow.svg|alt=|link=]]|none|none|none}}

Here, if |outcome= is set to merge, the merge-arrow icon is shown; for redirect, draftify, or any unrecognised/blank value (i.e., a normal deletion nomination), no icon (none) is shown instead.

It is also used to build the sentence describing what the discussion will decide, with a separate call supplying the "merging", "redirecting", "draftification", and "deletion" wording used throughout the notice.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Article for deletion in articles based on its TemplateData.

TemplateData for Article for deletion

A helper template used by Template:Afd to choose wording appropriate to the requested outcome of a deletion discussion (merge, redirect, draftify, or delete). Not intended for standalone use.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Value to test1

The outcome value being checked, usually {{{outcome|}}} passed through from Template:Afd. Recognised values are merge, merging, redirect, redirecting, draft, draftify, draftifying, and draftification; anything else (including blank) falls through to the default.

Stringrequired
Merge text2

Text returned when parameter 1 is "merge" or "merging".

Contentrequired
Redirect text3

Text returned when parameter 1 is "redirect" or "redirecting".

Contentrequired
Draftify text4

Text returned when parameter 1 is "draft", "draftify", "draftifying", or "draftification".

Contentrequired
Default (deletion) text5

Text returned for any value not matched above, including a blank value, "delete", or "deletion". This is effectively the deletion case.

Contentrequired

See also