Vorlage:Ifsubst: Unterschied zwischen den Versionen

K
20 Versionen von wikivoyage:Vorlage:Ifsubst importiert
imported>David Kernow
(category, some rephrasing, internal layout)
K (20 Versionen von wikivoyage:Vorlage:Ifsubst importiert)
 
(16 dazwischenliegende Versionen von 9 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
<!--Start building conditional:
{{ {{{|safesubst:}}}#if:{{{demo|}}}
--->{{#<!--
|{{ {{{|safesubst:}}}#ifeq:{{{demo}}} |no
--->{{<includeonly>subst:</includeonly>#if:||i}}f:<!--
|{{{no|{{{2|}}}}}}
--->{{<include<!--
|{{{yes|{{{1|}}}}}}
--->{{<includeonly>subst:</includeonly>#if:||only}}><!--
}}
--->subst:</include<!--
|{{ {{{|safesubst:}}}#ifeq:{{ {{{|safesubst:}}}NAMESPACE}}|{{NAMESPACE}}
--->{{<includeonly>subst:</includeonly>#if:||only}}><!--
|{{{no|{{{2|}}}}}}
--->Empty template|.}}<!--
|{{{yes|{{{1|}}}}}}
--->|<!--(else)-->{{{else|{{{2|}}}}}}<!--
}}}}<noinclude>
--->|<!--(then)-->{{{then|{{{1|}}}}}}}}<noinclude>
{{Documentation}}
<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:Function templates|{{PAGENAME}}]]
 
<!--Other languages-->
[[vi:Tiêu bản:Ifsubst]]
</noinclude>
</noinclude>