Template

Evd/doc

From Joomla! Documentation

< Template:Evd
Revision as of 18:13, 3 February 2008 by CirTap (talk | contribs) (found "bug" with recursive transclusion due to PAGENAME variable :( The original doc was part of the template itself.)
This is a documentation subpage for Template:Evd.
It contains usage information, categories and other content that is not part of the original template page.
To view the template page itself, see Template:Evd.

This template Template:evd (talk, backlinks, edit) shows the call of a template or predefined template and its result, for documentation.|

Usage:
{{evd|left side|up to 3 additional parameters}}
{{evd|left side|up to 3 additional parameters|s=separator}}
The default separator is "gives", use s== or similar to get "=" etc. Please note that for parser functions the first parameter belongs to the left side before the "|" vertical bar aka pipe.

Examples without additional parameters:

Examples:

  1. {{evd|CURRENTDAY|s=is}} displays
    {{CURRENTDAY}} is 12
  2. {{evd|#expr:2*3}} displays
    {{#expr:2*3}} gives 6
  3. {{evd|1=#expr:2+2=5}} displays
    {{#expr:2+2=5}} gives 0
  4. {{evd|1=#expr:(2+2=4)|s==}} displays
    {{#expr:(2+2=4)}} = 1
  5. {{evd|urlencode:!|s=&#61;}} displays
    {{urlencode:!}} = %21
  6. {{evd|uc:abc}} gives
    {{uc:abc}} gives ABC
  7. {{subst:evd|uc:Upper Case|subst=subst:}} substitutes
    {{ subst:uc:Upper Case}} gives UPPER CASE
    See Help:Substitution for several caveats wrt subst=subst:.

As always the expression (first parameter) cannot directly contain "|", "=", plus other special cases related to square brackets / curly braces. In the case of this template "not directly" means "never" except from "=" as shown above.

This template and template:Evdn (edittalklinkshistory) can be used if the case of an expression in double braces which itself includes a pair of double braces (simple nested expressions). For the former, use named parameters 1n (Nested part of first parameter) and optionally 1a (part After that). For the latter, use "|" for the inner "{{" and, if there is code after it, also for "}}".

  1. {{evd|#expr:24*|1n=CURRENTDAY}} gives {{#expr:24*{{CURRENTDAY}}}} gives 288
  2. {{evdn|#expr:24*|CURRENTDAY}} gives {{ #expr:24*{{ CURRENTDAY}}}} gives 288
  3. {{evd|#expr:24*|1n=CURRENTDAY|1a=-24}} gives {{#expr:24*{{CURRENTDAY}}-24}} gives 264
  4. {{evdn|#expr:24*|CURRENTDAY|-24}} gives {{ #expr:24*{{ CURRENTDAY}}-24}} gives 264
  5. {{evdn|#expr:4*|#expr:not 0| >3 | yields}} displays
    {{ #expr: 4*{{ #expr:not 0}} >3 }} yields 1
  6. {{evdn|urlencode:|DIRMARK}} displays
    {{ urlencode:{{ DIRMARK}}}} gives %E2%80%8E

Examples with additional parameters (no nesting possible):

Example:
{{evd|#ifeq: 1.00|+1|okay}} gives:
{{#ifeq: 1.00|+1|okay}} gives okay
Example:
{{evd|#ifeq: this|that||false|s=is}} gives:
{{#ifeq: this|that||false}} is false
Example:
{{evd|#expr: 3*4}} gives:
{{#expr: 3*4}} gives 12
Example:
{{evaldemo|#expr: 3*4}} gives:
{{ #expr: 3*4}} gives 12
{{tc}} gives in
{{t|b}} gives start>b<end
{{t|b|c}} yields start>b<end
{{t2|b|c}} gives parameter 1 is ( b ) , parameter 2 is ( c )
{{t2|b|c|d}} gives parameter 1 is ( b ) , parameter 2 is ( c )
{{t2|b|c|d}} yields 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.:

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

Optional substitution with subst=subst: is not supported. It's anyway against the spirit of this demo template showing what another template actually does, and not what it did some time ago.