From Joomla! ドキュメンテーション

[view] [edit] [history]

Template documentation


This Template:xpd (talk, backlinks, edit) (expansion demo) shows the call of a variable, parser function or template and its result, for documentation.


{{xpd|left side|up to 3 additional parameters}}

Please note that for parser functions the first parameter belongs to the left side before "|".


without additional parameters:


{{tc}} gives in


{{CURRENTDAY}} gives 19


{{#expr:2*3}} gives 6


{{#expr:2+2=5}} gives 0


{{#expr:2+2=4}} gives 1


{{urlencode:!}} gives %21


{{uc:abc}} gives ABC

{{subst:xpd|uc:Upper Case|subst=subst:}} substitutes {{ subst:uc:Upper Case}} gives UPPER CASE

See Help:Substitution for several caveats wrt subst=subst:.

Note that, as always, a parameter containing "=" has to be explicitly named by putting, in this case, "1=" in front.

Template:xpdn (talk, backlinks, edit) can be used in the case of an expression in double braces which itself includes a pair of double braces (simple nested expressions). Use "|" for the inner "{{" and, if there is code after it, also for "}}".


{{ #expr:24*{{ CURRENTDAY}}}} gives 456


{{ #expr:24*{{ CURRENTDAY}}-24}} gives 432

{{xpdn|#expr:4*|#expr:not 0| >3}}

{{ #expr: 4*{{ #expr:not 0}} >3}} gives 1


{{ urlencode:{{ DIRMARK}}}} gives %E2%80%8E

Examples with additional parameters (no nesting possible):

{{xpd|#ifeq: 1.00|+1|okay}}

{{#ifeq: 1.00|+1|okay}} gives okay

{{xpd|#ifeq: this|that||false|s=is}}

{{#ifeq: this|that||false}} is false


{{t|b}} gives start>b<end


{{t2|b|c}} gives parameter 1 is ( b ) , parameter 2 is ( c )

In the case of one or more named parameters, write all parameter definitions from that as value of the appropriate parameter number, e.g. to pass 'wikt=abc' as 2nd argument assign it to '2=' using:

{{xpd|t link|2=wikt=abc|3=}} gives "{{t link|wikt=abc|}} gives wikt=abc"

Optional substitution with subst=subst: is not supported. The xpd templates show what another template actually does, and not what it did some time ago.

Separator parameter

The default separator of template code and its result is "gives", use s== or similar to get "=" etc.


{{xpd|left side|up to 3 additional parameters|s=separator}}

{{xpdn|left side|nested part and optional last part|s=separator}}

Examples with separator parameter:


{{CURRENTDAY}} is 19


{{#expr:2+2}} = 4

{{xpdn|#expr:4*|#expr:not 0| >3 | yields}}

{{ #expr: 4*{{ #expr:not 0}} >3 }} yields 1

Xpd is based on: Xpd (doc page, history)