Jump to content

Do not begin to migrate content here, it may be wiped without notice. More info.

Template:Action

From Debian Wiki
Revision as of 09:53, 17 April 2026 by RogueScholar-guest (talk | contribs) (Give the template some actual documentation and flesh out the functionality with parameterized control over action, link target and text)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

edit page

This template, {{Action}}, produces links that perform an action on the target page through the use of URL query parameters. The design goal is to provide equivalent functionality to MoinMoin's <<Action()>> macro. Note that this only replicates functionality that existed on the Debian wiki at the time of migration—other actions may be supported by MoinMoin itself.

Usage

The baseline behavior for the template is to produce a link to edit the page it appears on, using the text: edit page; when invoked with no parameters that will always be the result.

Parameters

This template currently accepts three parameter values, though none of them are strictly required. They are each independent of the others and can be used individually or in any combination to suit the situation. They may be used either by name or as unnamed positional parameters, but beware that the latter style requires that parameters always be defined in tandem with any others that precede them in the positional sequence (i.e., you can only set the second parameter along with the first, and only set the third after the other two). The loophole in that scenario is that the preceding positional parameters do not need to be used, per se, since null (empty) values are accepted as valid.

Position Name Description
1st |action= One of a set of keywords that specify the desired page action to trigger, with edit as the default when not defined. The list of valid keywords can be found in the § TemplateData section below.
2nd |page= The name of the page to perform the action on, including the namespace if not in Main. If |action=<login|preferences|recoverpass|userprefs>, this parameter is ignored.
3rd |text= The text to be linked to the page action; when undefined sensible defaults are used.

Link text

The default link text used by each of the action keywords is as follows:

Default values for |text=/|3= based on |action=/|1=
Action keyword Default text
edit edit page
history, info, log view history
login, recoverpass reset password
preferences, userprefs preferences
subscribe, watch add to watchlist

TemplateData

Produces linked text that triggers an action on the target page through the use of URL query parameters; specifically designed as a drop-in replacement for MoinMoin-style action behaviors

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Page actionaction 1

The action to trigger on the target page

Suggested values
edit history info log login preferences recoverpass subscribe userprefs watch
Default
edit
Example
history
Linerequired
Target pagepage 2

The page to perform the action on, defaults to the transcluding page if omitted.

Default
{{FULLPAGENAME}}
Example
Doc-base
Page namesuggested
Link texttext 3

The displayed text that will be linked to the page action; sensible defaults will be used if omitted.

Example
Edit me!
Lineoptional

Template demo / sandbox

A demonstration page for its feature set is available at ExampleForAction.