Template:Ifsubst: Difference between revisions

429 bytes removed ,  2 years ago
m
20 revisions imported from wikipedia:Template:Ifsubst
No edit summary
m (20 revisions imported from wikipedia:Template:Ifsubst)
 
(11 intermediate revisions by 6 users not shown)
Line 1:
{{ {{{|safesubst:}}}#if:{{{demo|}}}
{{#{{<includeonly>subst:</includeonly>#if:||i}}f:{{<include{{<includeonly>subst:</includeonly>#if:||only}}>subst:</include{{<includeonly>subst:</includeonly>#if:||only}}>Empty template|.}}|<!--else-->{{{else|{{{2|}}}}}}|<!--then-->{{{then|{{{1|}}}}}}}}<noinclude><pre>{{subst:ifsubst|then|else}}</pre>
|{{ {{{|safesubst:}}}#ifeq:{{{demo}}} |no
 
|{{{no|{{{2|}}}}}}
Add the above code to a template of yours to give it <code>ifsubst</code> functionality. Note that this template in itself must actually be substituted into your new one, becoming part of its code.
|{{{yes|{{{1|}}}}}}
 
}}
With the additional code, if your template is substituted, your "then" text will appear, else your "else" text.
|{{ {{{|safesubst:}}}#ifeq:{{ {{{|safesubst:}}}NAMESPACE}}|{{NAMESPACE}}
[[Category:Wikipedia special effects templates|Ifsubst]]
|{{{no|{{{2|}}}}}}
 
|{{{yes|{{{1|}}}}}}
[[vi:Tiêu bản:Ifsubst]]
}}}}<noinclude>
{{Documentation}}
</noinclude>