Template:Ifsubst: Difference between revisions

finalise
(fix - still test)
(finalise)
Line 1:
<noinclude><code></noinclude>{{#{{<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></codepre>{{subst:ifsubst|then|else}}</noincludepre>
 
Add the above code to a template of yours to give it <code>ifsubst</code> functionality. If your template is substituted, your "then" text will appear, else your "else" text. Note that this template in itself must be substituted into your new one.
 
[[Category:Wikipedia special effects templates|Ifsubst]]</noinclude>
{{{{{operand|subst:}}}#if:{{<includeonly>subst:</includeonly>Empty template|.}}|SUBST ME|ok}}
Anonymous user