Template:Ifdef/doc

Watchers

This template is for use in other templates. It allows a template to define a behavior that occurs only when a specified parameter is defined.

Usage

Place the following in a template:

{{Ifdef|{{{parm|}}}|result}}}

where parm is the number or name of a template parameter and result is the desired result if the parameter has a value.

Example

{{Ifdef|{{{2|}}}|[[{{NAMESPACE}}:{{{2}}}|{{{2}}}]]}}

which expects parameter 2 to be a page title (without the namespace), will display a link to the page if parameter 2 has a value, and will display nothing if parameter 2 has no value.

Source

This template is copied from https://meta.wikimedia.org/wiki/Template:Ifdef.

See also