Chinazi Wiki Difference between revisions of "Template:Parameter names example"

Difference between revisions of "Template:Parameter names example"

Template page
m (1 revision imported)
m (1 revision imported)
(No difference)

Latest revision as of 02:11, 27 August 2021

Template documentation[view][edit][history][purge]
This documentation is transcluded from Template:Parameter names example/doc. Changes can be proposed in the talk page.
Template:Parameter names example invokes function main in Module:Parameter names example using Lua.

{{Parameter names example}} is intended to assist template documentation by producing a generic instance of the template that uses parameters' names as those parameters' values.


The example opposite for {{Infobox}}, for instance, was produced by:

{{Parameter names example 
|_template=Infobox temp |title |image |row 1 title |row 1 info |row 2 title |row 2 info |row 3 title |row 3 info |row 4 title |row 4 info |row 5 title |row 5 info |row 6 title |row 6 info |row 7 title |row 7 info |row 8 title |row 8 info |row 9 title |row 9 info |row 10 title |row 10 info |row 11 title |row 11 info |row 12 title |row 12 info

Usage notes

When {{Parameter names example}} is used on an immediate subpage of its target template – e.g. on the target template's /doc page – its own Template:Para 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 Template:Para parameter explicitly.

The formatting of the parameter names can be changed with the Template:Para parameter. By default, the parameter names are shown in triple braces (the parameter standard, e.g. {{{name}}}Template:Thin space), but if Template:Para or Template:Para is set, they are shown in italics.

A custom value for a parameter may be supplied by using Template:Para 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. Template:Para). Custom values cannot be used for parameters whose names begin with an underscore ("_").

See also