Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a2a7c677c8022780

Jump to content

Template:Article for deletion/switch/doc

From Wikipedia, the free encyclopedia

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

[edit]

{{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 |outcome= 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

[edit]

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

[edit]
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/switch in articles based on its TemplateData.

TemplateData for Article for deletion/switch

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

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

[edit]