Template:Ifsubst: Difference between revisions

From All Skies Encyclopaedia
imported>Amalthea
(New, more useful version, using safesubst.)
imported>Dinoguy1000
(fix "|=foo" bug)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{ safesubst:<noinclude/>#if:{{{demo|}}}
{{ {{{|safesubst:}}}#ifeq:{{ {{{|safesubst:}}}NAMESPACE}}|{{NAMESPACE}}|{{{1|}}}|{{{2|}}} }}<noinclude>
|{{ safesubst:<noinclude/>#ifeq:{{{demo}}} |no
{{Documentation|content=
|{{{no|{{{2|}}}}}}

|{{{yes|{{{1|}}}}}}
===Usage===
Meta template that returns the first parameter if evaluated during substitution, and the second parameter if evaluated during transclusion.<br>Note that this template must be used in [[meta:Help:Safesubst|safesubst]] mode to work properly:

:<code><nowiki>{{ {{{|safesubst:}}}ifsubst| yes | no }}</nowiki></code>

<!--Categories-->
[[Category:Wikipedia metatemplates|{{PAGENAME}}]]

}}
}}
|{{ safesubst:<noinclude/>#ifeq:{{ safesubst:<noinclude/>NAMESPACE}}|{{NAMESPACE}}
|{{{no|{{{2|}}}}}}
|{{{yes|{{{1|}}}}}}
}}}}<noinclude>
{{Documentation}}
</noinclude>
</noinclude>

Latest revision as of 08:48, 2 January 2022