Template documentation

This template provides branching without Extension:ParserFunctions for simple "if defined then do" statements without else part. It is the opposite of Template:Ifndef.

See Template:Ifwpc for an overview of results, and comparisons.

Usage

edit

{{ifdef|value|result}} yields result  if value  isn't blank.

It uses the code {{{1{{{1|}}}|{{{2|}}}}}}.

Examples

edit
Code Result
{{ifdef|x|y}} y
{{ifdef||y}}
{{ifdef|2=y}} y
{{ifdef|x}}
{{ifdef|}}
{{ifdef}}

Substitution

edit

Convenient of the parameter default mechanism is that substitution works also, without any extra code.

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools.

TemplateData for Ifdef

"IF defined THEN do"

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Value1

no description

Contentsuggested
Result2

Output when parameter 1 isn't blank.

Contentrequired
Edit parameter translations