Template:Ifsubst/doc: Difference between revisions

From Bonkipedia
[[mw:]]>ExE Boss
 
m (1 revision imported: Template documentation pages)
 
(No difference)

Latest revision as of 18:04, 12 November 2022

Usage

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

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