Jump to content

Template:Color box/doc

From Wikihoc

{{#ifeq:doc |doc

    | 

{{#ifeq:show |show

|

        }}{{#if:|
         |{{#ifexist:Template:Color box
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
                  | 
                 }}
        }}
    | 
   }}

Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.

Usage

{{#ifeq:{{safesubst:#switch: {{{header}}}

|no
|n
|f
|false
|off
|0        = no
|         = yes
|¬        = yes
|yes
|y
|t
|true
|on
|1        = yes
|#default = yes

}}|yes|

{{#if:|{{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Color box|Template:Color box|this template}} in articles{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:Color box|Template:Color box|Template:Color box}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.

|#default=[1]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:

|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Color box|Template:Color box|this template}} in articles{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.

|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}

|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3AColor+box%7CColor+box%7CColor+box%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}}
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|no|P|p}}arameter usage report] for {{#if:Color box|Template:Color box|Template:Color box}}{{#ifeq:{{safesubst:#switch: y

|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}}.

|#default=[2]{{#ifeq:{{safesubst:#switch: y
|no
|n
|f
|false
|off
|0        = no
|         = no
|¬        = no
|yes
|y
|t
|true
|on
|1        = yes
|#default = no

}}|yes| based on {{#if:Color box|its|this}} TemplateData}} }}}}

TemplateData for Color box

{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Template|Template
   | template
   | other
   }}
 }}

| template = {{safesubst:#if:{{safesubst:#ifeq:doc|sandbox|1}}{{safesubst:#ifeq:doc|doc|1}}||

}} | other | #default = }}

}}

{{color box|color|text|text color}}
Adds a rectangular color box.
  • Colors are most commonly specified as either a color keyword or as the hexadecimal triplet representing an RGB combination. See the article web colors for details.
  • If specified, the text is centered within the box.
Color1
Background color of the box.
⧼templatedata-doc-param-example⧽
Green
Text2
Adds text inside the box; box is otherwise an empty square.
⧼templatedata-doc-param-example⧽
Hello, world!
Text color3
Sets the color of the text inside the box.
⧼templatedata-doc-param-default⧽
Either black or white; whichever has greater contrast.
⧼templatedata-doc-param-example⧽
Yellow
Border colorborder
Sets the color of the border around the box.
⧼templatedata-doc-param-default⧽
black
⧼templatedata-doc-param-example⧽
#FF0
Examples
Visual effect Markup
{{#if: {{{2}}}| {{{2}}} }}  }} {{color box|Green}}
{{#if:Default color for this text Default color for this text| Default color for this text }}  }} {{color box|Yellow|Default color for this text}}
{{#if:Default color for this text Default color for this text| Default color for this text }}  }} {{color box|Blue|Default color for this text}}
{{#if:Using X11 color names Using X11 color namesUsing X11 color names }}  }} {{color box|SteelBlue|'''Using X11 color names'''|Gold}}
{{#if:Using RGB hex triplets Using RGB hex tripletsUsing RGB hex triplets }}  }} {{color box|#012345|''Using RGB hex triplet''|#FEDCBA}}
{{#if:Red Red| Red }}  }} {{color box|Yellow|Red|#f00|border=#f00}}
{{#if:bordercolor like wikitable bordercolor like wikitable| bordercolor like wikitable }}  }} {{color box|white|bordercolor like wikitable|border=#A2A9B1}}

Variants

Color box templates
Template Description Example
{{Color box}} Color box size with black borders and text color. Standard size. {{#if: {{{2}}}| {{{2}}} }}  }} or {{#if:ORANGE ORANGE| ORANGE }}  }}
{{Color box striped}} Striped color box. Standard size.  {{{3}}} |    }}
{{RouteBox}} Borderless color box with text color and wikilinks. ORANGE | ORANGE }} 
{{Colorbull}} Colored bullet with wikilinks. [[{{{3}}}|{{#switch:{{{2}}} circle|r|round = ● diamond = ◆ up|uptriangle = ▲ dn|downtriangle = ▼ lt|lefttriangle = ◀ rt|righttriangle = ▶ #default = ■

}}]]|{{#switch:{{{2}}}

circle|r|round = ● diamond = ◆ up|uptriangle = ▲ dn|downtriangle = ▼ lt|lefttriangle = ◀ rt|righttriangle = ▶ #default = ■

}}}}

{{Legend inline}} Color box size with black borders. Standard size. {{#if:  }} 
{{Color sample}} Color box size with black borders. Smaller size.
{{Swatch inline}} orange|orange}}
{{Background color}} orange{{safesubst:#switch:
 {{safesubst:#if: 
{{{demospace}}} main other
   }} 
 }}
{{#ifexpr:1 < 7 OR 10.634053407262 < 7 AND 1.9747879003183 < 7|}}}} other #default =

}}{{#switch:

 {{#if:
{{{demospace}}} Template template other
   }}
 }}
{{#ifexpr:1 < 7 OR 10.634053407262 < 7 AND 1.9747879003183 < 7|}}}} other #default =

}}

{{Rail color box}} A version with more display options. Part of Module:Adjacent stations , Orange
{{Diagonal split color box}} Color box split diagonally. Standard size.
{{#ifexpr:{{#ifeq:
0}} and {{#if:|1|0}} {{#ifeq: {{#if:
   
}}
   
{{#if:
   
}}
  {{{4}}}|   }}
   
}}
{{#if: {{{4}}}| }}
{{#if:|{{{3}}}|   }}
  {{{4}}}|{{#if:| |   }}}}
{{#if:|{{{3}}}|{{#if:| |   }}}}
}}}}

Supporting template

See also