Template:Ifsubst/doc
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/doc
<templatedata>{"paramOrder":["1","2","demo"],"description":"Meta-template that shows different results when substituted or transcluded.","params":{"demo":{"suggested":false,"type":"string","autovalue":"{{{demo|<noinclude>1</noinclude>}}}","label":"Demo?","description":"Whether to show the substituted result regardless of whether the template was actually substituted. Set to “no” to always show the transcluded result."},"1":{"suggested":true,"type":"content","description":"The result when this template is substituted.","label":"Substituted"},"2":{"suggested":true,"type":"content","autovalue":"{{error:must be substituted|{{subst:#switch:{{subst:NAMESPACE}}|{{subst:ns:10}}=|{{subst:ns:0}}=:|#default={{subst:NAMESPACE}}:}}{{subst:PAGENAME}}}}","label":"Transcluded","description":"The result when this template is not substituted."}}}</templatedata>Edit parameter translations