Template:Igen/cbx

From "PTTLink Wiki"
< Template:Igen
Revision as of 07:59, 24 January 2022 by Kg7qin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This Image generation subtemplate performs a display of color boxes, by e.g. {{Legend}}.

Transclusion (Igen):

{{ Igencb = 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

¹) 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 0 and its talk page.