Difference between revisions of "Template:Igen/cbx"
Jump to navigation
Jump to search
Mediawiki>Sarang m (+parm) |
m (1 revision imported) |
Latest revision as of 07:59, 24 January 2022
This Image generation subtemplate performs a display of color boxes, by e.g. {{Legend}}.
30px | This template uses Lua: |
{{ Igen | cb = textstring }}
- only one parameter: either a color name (e.g. "lime") or a color triplet (e.g. "#FC23C4" or "#F0F")
- a parameter pair, like above plus a display text separated by a slash "/",
- or the slash only for an empty second parameter (the first parameter will be used)
- more parameters pairs, like that, separated by slashes
In any of these cases this string can be preceded by a control code pair, e.g. "+/ ";
the first code may be missing, or a "+" to generate a field name; the second parameter may be
- missing for {{Legend}} with parameter pairs,
- a "-" for {{Legend-small}} with parameter pairs ¹)
- a "L" for the {{Legend}} with single parameter values ²)
- a "B" for {{Color boxes}} with single parameter values
- a "S" for {{Color boxes}} with single parameter values
- a "D" for {{Color boxes}} with parameter pairs
- a "T" for {{Tbc}} with parameter pairs
- ¹) the "-" possibility can also be expressed with an "M" or "C" (caption "Color")
- ²) the "L" possibility exists just for completion – normally a "Legend" without an explaining second value will not be useful.
- Transclusion (Igen/cbx)
All slashes are replaced by pipes, so this template gets a row of unnamed parameters.
When the second parameter of a pair is missing, the first parameter will be displayed instead.
When the first parameter of such a pair is empty, the template terminates.
Template Igen/cbox and LUA module Template:M is used.
See examples at Template:ColorString and its talk page.