Template:Para/doc

From TrainzOnline
< Template:Para
Revision as of 14:51, 2 July 2013 by Fabartus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


 
It contains usage information, categories and other informational content that is best arranged so that it is not part of the original template page, such as in many cases, examples of how to use the template in question.
  • Documentation subpages were developed to reduce server demands, or to protect the code version of widely used templates.
     

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 {{{{#if:| }}para{{#if:| | {{{2}}} }}{{#if:| | {{{3}}} }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if:| }}}} parameter is empty) an unnamed example parameter.

Examples

  1.   {{{{#if:name| }}para{{#if:name|

| name }}{{#if:| | {{{3}}} }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if:name| }}}}

  1. renders as
    |{{#if:name|name=|}}
  2.   {{{{#if:title| }}para{{#if:title|

| title }}{{#if:<var>book title</var>| | <var>book title</var> }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if:title| }}}}

  1. renders as
    |{{#if:title|title=|}}book title
  2.   {{{{#if: | }}para{{#if: |

|   }}{{#if:section| | section }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if: | }}}}

  1. renders as
    |{{#if:|=|}}section
    (for unnamed parameters in the example code; note the empty first parameter in the {{{{#if:| }}para{{#if:|

| {{{2}}} }}{{#if:| | {{{3}}} }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if:| }}}} template)

  1.   {{{{#if:<var>parameter</var>| }}para{{#if:<var>parameter</var>|

| <var>parameter</var> }}{{#if:<var>value</var>| | <var>value</var> }}{{#if:| | {{{4}}} }}{{#if:| | {{{5}}} }}{{#if:| | ... }}{{#if:<var>parameter</var>| }}}}

  1. renders as
    |{{#if:parameter|parameter=|}}value

When using literal, pre-specified values, simply provide the value (appearance as in example 3). When illustrating hypothetical, variable or user-definable values, use <var>value</var> (appearance as in example 2), and the same should be done for non-literal, example parameters (as in example 4).

See also

  • Template:Tlx – for providing examples of entire-template code with included parameters
Personal tools