wikipedia>Edokter
mNo edit summary
wikipedia>Edokter
Rv self
Line 4: Line 4:


== Usage ==
== Usage ==
This template is for giving examples of [[Wikipedia:Template messages|template]] parameter source code (useful in template documentation and talk page discussions of template code).  It must have one or two parameters. When both are given, the first is the name of the example parameter name to display, and the second one is the value. For an unnamed example parameter, you only need to give the value parameter.
This template is for giving examples of [[Wikipedia:Template messages|template]] parameter source code (useful in template documentation and talk page discussions of template code).  It must have one or two parameters itself. The first is the name of the example parameter to display (this may be ''empty'', but it '''must''' be ''present''), and the second (optional) one is a value for the first example parameter, or (if the first {{tlx|para}} parameter is empty) an unnamed example parameter.


===Examples===
===Examples===
{{Aligned table
{{Aligned table
  | cols=2 | col1style=padding-right:1.0em;  
  |cols=3 |col1style=padding-right:1.0em; |col2style=padding-right:1.5em;
  | '''Code'''
  | '''Code'''
  | '''Result'''
  | '''Result'''
| '''Notes'''


  | {{tlx|para|value}}
  | {{tlx|para|name}}
  | {{when in sandbox |{{para/sandbox|value}} |{{para|value}} }}
  | {{when in sandbox |{{para/sandbox|plain|name}} |{{para|name}} }}
|


  | {{tlx|para|title|<var>book title</var>}}
  | {{tlx|para|title|<var>book title</var>}}
  | {{when in sandbox |{{para/sandbox|title|<var>book title</var>}} |{{para|title|<var>book title</var>}} }}
  | {{when in sandbox |{{para/sandbox|plain|title|<var>book title</var>}} |{{para|title|<var>book title</var>}} }}
|
 
| {{tlx|para|2=<span style="font-size:1pt;">&nbsp;</span>|3=section}}
| {{when in sandbox |{{para/sandbox|plain||section}} |{{para||section}} }}
| For [[Help:Templates#Parameters|unnamed parameters]]; note empty first parameter in the code


  | {{tlx|para|&lt;var&gt;parameter&lt;/var&gt;|&lt;var&gt;value&lt;/var&gt;}}
  | {{tlx|para|&lt;var&gt;parameter&lt;/var&gt;|&lt;var&gt;value&lt;/var&gt;}}
  | {{when in sandbox |{{para/sandbox|plain|<var>parameter</var>|<var>value</var>}} |{{para|<var>parameter</var>|<var>value</var>}} }}
  | {{when in sandbox |{{para/sandbox|plain|<var>parameter</var>|<var>value</var>}} |{{para|<var>parameter</var>|<var>value</var>}} }}
|
}}
}}
 
When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable or user-definable values, use {{plaincode|<nowiki><var>value</var></nowiki>}} (as in the second example above) and the same should be done for non-literal, example parameters (fourth example above).
When illustrating hypothetical, variable or user-definable values, use {{plaincode|<nowiki><var>value</var></nowiki>}} (as in the second example above) and the same should be done for non-literal, example parameters (third example above).


== See also ==
== See also ==
Line 28: Line 35:
* {{tl|Tlx}}, for providing examples of entire-template[?] code including parameters.
* {{tl|Tlx}}, for providing examples of entire-template[?] code including parameters.
{{Tl-nav}}
{{Tl-nav}}
* {{tl|Parameter}}


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||

Revision as of 21:18, 6 November 2014

Template:Documentation subpage Template:Distinguish

Usage

This template is for giving examples of template parameter source code (useful in template documentation and talk page discussions of template code). It must have one or two parameters itself. The first is the name of the example parameter to display (this may be empty, but it must be present), and the second (optional) one is a value for the first example parameter, or (if the first {{para}} parameter is empty) an unnamed example parameter.

Examples

Template:Aligned table When using literal, pre-specified values, simply provide the value (as in the third example above). When illustrating hypothetical, variable or user-definable values, use Template:Plaincode (as in the second example above) and the same should be done for non-literal, example parameters (fourth example above).

See also

  • {{Param}}
  • {{Tlx}}, for providing examples of entire-template[?] code including parameters.

Template:Tl-nav