Template:Ifsubst

From mediawiki.org
Jump to navigation Jump to search
Template documentation

Usage[edit]

Meta template that returns the first parameter if evaluated during substitution, and the second parameter if evaluated during transclusion.
Note that this template must be used in safesubst mode to work properly:

{{ {{{|safesubst:}}}ifsubst| yes | no }}

The |demo= parameter can be used for testing the template. Set |demo=yes to always display the yes text, |demo=no to always display the no text, or |demo={{{demo|}}} to pass through the value from the parent template.

TemplateData[edit]

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Ifsubst

Meta-template that shows different results when substituted or transcluded.

Template parameters

ParameterDescriptionTypeStatus
Substituted1

The result when this template is substituted.

Contentsuggested
Transcluded2

The result when this template is not substituted.

Auto value
{{error:must be substituted|{{subst:#switch:{{subst:NAMESPACE}}|{{subst:ns:10}}=|{{subst:ns:0}}=:|#default={{subst:NAMESPACE}}:}}{{subst:PAGENAME}}}}
Contentsuggested
Demo?demo

Whether to show the substituted result regardless of whether the template was actually substituted. Set to “no” to always show the transcluded result.

Auto value
{{{demo|<noinclude>1</noinclude>}}}
Stringoptional
Edit parameter translations