Template:Parameter names example
{{#ifeq:parameter names example |doc
|
{{#ifeq:show |show
|This is a documentation subpage for Template:Parameter names example. It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:Parameter names example | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
Uses Lua: |
{{Parameter names example}} � or, alternatively, {{Generic template demo}} � is intended to assist template documentation by producing a generic instance of the template that uses parameters' names as those parameters' values.
Example[edit]
The example opposite for {{Infobox}}, for instance, was produced by:
{{{above}}} | |
---|---|
{{{subheader2}}} | |
{{{image}}} {{{caption}}} | |
{{{header1}}} | |
{{{label2}}} | {{{data2}}} |
{{{label3}}} | {{{data3}}} |
{{{header4}}} | |
{{{data5}}} | |
{{{data6}}} | |
{{{below}}} |
{{Parameter names example |_template=Infobox |above |image |subheader |subheader2 |image |caption |label1 |label2 |data2 |label3 |data3 |header4 |data5 |data6 |below }}
Usage notes[edit]
When {{{{#if:Parameter names example|Parameter names example| tlf|...}}{{#ifeq:x|| |{{{2}}} | }}{{#ifeq:x|| |{{{3}}} | }}{{#ifeq:x|| |{{{4}}} | }}{{#ifeq:x|| |{{{5}}} | }}{{#ifeq:x|| |{{{6}}} | }}{{#ifeq:x|| |{{{7}}} | }}{{#ifeq:x|| |{{{8}}} | }}{{#ifeq:x|| |{{{9}}} | }}}} is used on an immediate subpage of its target template � e.g. on the target template's /doc page � its own |{{#if:_template|_template=}}
parameter identifying the target template may be omitted. In other words, the code above, if used on Template:Infobox/page (where page could be "doc", "testcases", etc.), would become:
{{Parameter names example |title |above |subheader |subheader2 |image |caption |header1 |label2 |data2 |label3 |data3 |header4 |data5 |data6 |below }}
One exception to this is the "sandbox" subpage. If the module is called from a page ending in "/sandbox", it uses that page to generate the template output, not the base page. To override this behaviour you can specify the |{{#if:_template|_template=}}
parameter explicitly.
The formatting of the parameter names can be changed with the |{{#if:_display|_display=}}
parameter. By default, the parameter names are shown in triple braces (the parameter standard, e.g. {{{name}}} {{#if:|{{{1}}} }}), but if |{{#if:_display|_display=}}italics
or |{{#if:_display|_display=}}italic
is set, they are shown in italics.
A custom value for a parameter may be supplied by using |{{#if:[parameter name]|[parameter name]=}}[value]
in place of |[parameter name]
. Any formatting for such a value � including, for instance, italics � must be supplied as part of the value (e.g. |{{#if:parameter|parameter=}}''value''<br/>
). Custom values cannot be used for parameters whose names begin with an underscore ("_").
See also[edit]
- Wikipedia:Template documentation
- Template:Parameters and Module:Parameters � generates a list of parameter names for a given template
{{#ifeq:Parameter names example|sandbox | | }}
The above documentation is transcluded from Template:Parameter names example/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
{{#if:|
[[Category:Template documentation pages{{#translation:}}]] }}