Template:Ifsubst: Difference between revisions
From All Skies Encyclopaedia
imported>RussBot m (Robot: moving pages out of redirected category) |
imported>Dinoguy1000 (fix "|=foo" bug) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ safesubst:<noinclude/>#if:{{{demo|}}} |
|||
<!--Start building conditional: |
|||
|{{ safesubst:<noinclude/>#ifeq:{{{demo}}} |no |
|||
--->{{#<!-- |
|||
|{{{no|{{{2|}}}}}} |
|||
--->{{<includeonly>subst:</includeonly>#if:||i}}f:<!-- |
|||
|{{{yes|{{{1|}}}}}} |
|||
--->{{<include<!-- |
|||
}} |
|||
--->{{<includeonly>subst:</includeonly>#if:||only}}><!-- |
|||
|{{ safesubst:<noinclude/>#ifeq:{{ safesubst:<noinclude/>NAMESPACE}}|{{NAMESPACE}} |
|||
--->subst:</include<!-- |
|||
|{{{no|{{{2|}}}}}} |
|||
--->{{<includeonly>subst:</includeonly>#if:||only}}><!-- |
|||
|{{{yes|{{{1|}}}}}} |
|||
--->Empty template|.}}<!-- |
|||
}}}}<noinclude> |
|||
--->|<!--(else)-->{{{else|{{{2|}}}}}}<!-- |
|||
{{Documentation}} |
|||
--->|<!--(then)-->{{{then|{{{1|}}}}}}}}<noinclude> |
|||
<pre>{{subst:ifsubst|then|else}}</pre> |
|||
Add the above code to a template 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. |
|||
When the template to which this code has been added is then substituted, the "then" text will appear, else the "else" text. |
|||
<!--Categories--> |
|||
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]] |
|||
<!--Other languages--> |
|||
[[vi:Tiêu bản:Ifsubst]] |
|||
</noinclude> |
</noinclude> |