Mal:Ifsubst: Forskjell mellom sideversjoner

Fra wikisida.no
Hopp til navigering Hopp til søk
imported>Alfakim
Ingen redigeringsforklaring
category, some rephrasing, internal layout
Linje 1: Linje 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>
<!--Start building conditional:
--->{{#<!--
--->{{<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>


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.
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.


With the additional code, if your template is substituted, your "then" text will appear, else your "else" text.
When the template to which this code has been added is then substituted, the "then" text will appear, else the "else" text.
[[Category:Wikipedia special effects templates|Ifsubst]]


<!--Categories-->
[[Category:Function templates|{{PAGENAME}}]]
<!--Other languages-->
[[vi:Tiêu bản:Ifsubst]]
[[vi:Tiêu bản:Ifsubst]]
</noinclude>
</noinclude>

Sideversjonen fra 16. feb. 2007 kl. 11:03

{{subst:ifsubst|then|else}}

Add the above code to a template to give it ifsubst 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.