Difference between revisions of "Template:Ifsubst"

From Self-sufficiency
Jump to: navigation, search
m (17 revisions from wikipedia:Template:Ifsubst)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{#{{<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:{{ {{{|safesubst:}}}NAMESPACE}}|{{NAMESPACE}}
 
+
|{{{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|}}}}}}
 
+
}}<noinclude>
With the additional code, if your template is substituted, your "then" text will appear, else your "else" text.
+
{{Documentation}}
[[Category:Wikipedia special effects templates|Ifsubst]]
+
 
+
[[vi:Tiêu bản:Ifsubst]]
+
 
</noinclude>
 
</noinclude>

Latest revision as of 12:07, 21 December 2011