Template:Legend-table

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
[[w:{{{lang}}} language|{{{lang}}}]] ({{{lang}}}):


Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Legend-table/doc.

Displays an unlimited number of Legends

Usage

{{Legend-table |lang= |title= |1= |2= |notes= }}

Template parameters

ParameterDescriptionDefaultStatus
langlanguageLanguage of the legendemptyrequired
titletitleA title for the legendemptyoptional
1color #1Color of the first line of the legendemptyrequired
2legend #1Legend for the first lineemptyrequired
3color #2Color of the second line of the legendemptyoptional
4legend #2Legend for the second lineemptyoptional
00 more parameters: 5, 7, 9, ... for colors,
E more parameters: 6, 8, 10, ... for legends
0optional
notesfootnotesOptional footnotes (use the <sup>1</sup> format
[both there and at the legend section])
emptyoptional
ttiptooltipspecify "yes" for colors tooltippingemptyoptional
aligntitle alignalignement of the title textcenteroptional
Template data
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Displays an unlimited number of [[:Template:Legend|Legend]]s<table class="plainlinks plainlinks ombox mbox-small ombox-notice" role="presentation"><tr><td class="mbox-image">[[File:Lua-logo-nolabel.svg|30px|alt=Lua logo|link=wikipedia:Wikipedia:Lua]]</td><td class="mbox-text">Uses [[wikipedia:Wikipedia:Lua|Lua]]: <div><ul><li>[[:Module:Iteration]]</li></ul></div></td></tr></table>[[Category:Lua-based iteration templates]]

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
color #11

Color of the first line of the legend

Numberrequired
legend #12

Legend for the first line

Stringrequired
color #23

Color of the second line of the legend

Numberoptional
legend #24

Legend for the second line

Stringoptional
<span style="visibility:hidden; color:transparent;">0</span>

<span style="visibility:hidden; color:transparent;">0</span> ''more parameters:'' 5, 7, 9, ... for colors,<br /> <span style="visibility:hidden; color:transparent;">E more parameters: </span> 6, 8, 10, ... for legends

Default
<span style="visibility:hidden; color:transparent;">0</span>
Unknownoptional
title alignalign

alignement of the title text

Default
center
Stringoptional
languagelang

Language of the legend

Stringrequired
footnotesnotes

Optional footnotes (use the <code>&lt;sup&gt;1&lt;/sup&gt;</code> format<br />[both there and at the legend section])

Lineoptional
titletitle

A title for the legend

Stringoptional
tooltipttip

specify "yes" for colors tooltipping

Unknownoptional

Additional information

The template is intended to be used in the following namespaces: the File namespace

The template is intended to be used by the following user groups: no user group specified

Example

{{Legend-table|lang=en|title=This is an optional title|align=left
|#000000|Kosovo
|#0052ff|States which formally recognise Kosovo as independent.<sup>1</sup>
|#5fadff|States which have stated they intend to recognise formally Kosovo as  independent.
|#cdcd9c|States with undecided, unclear or ambiguous positions.
|#E5A238|States which have expressed disagreement with unilateral moves or expressed wish for further negotiations.
|#FF4500|States which have stated they will not recognise Kosovo as independent.
|#a3a3a3|States with no reported position at present.
|notes=<sup>1</sup>This is an optional area for footnotes.
}}

renders as:

English (en): This is an optional title
 
Kosovo
 
States which formally recognise Kosovo as independent.1
 
States which have stated they intend to recognise formally Kosovo as independent.
 
States with undecided, unclear or ambiguous positions.
 
States which have expressed disagreement with unilateral moves or expressed wish for further negotiations.
 
States which have stated they will not recognise Kosovo as independent.
 
States with no reported position at present.
1This is an optional area for footnotes

See also

Localization

This template is not intended to be localized.