Template:Color number

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

[[Category:{{{1}}} numbers| 07 {{{2}}}]][[Category:Number {{{2}}} by color]]

Purpose

[edit]

Template:Color number is to be added to categories with media of numbers of a particular color (e.g. Category:White number 000). It uses WikiData to get color information and display a header, and categorizes by color and number.

Usage

[edit]
{{Color number|1|2|di|ui|rimage}}
  • 1 - color
  • 2 - number
  • di - downward increment for numbered category list
  • ui - upward increment for numbered category list
  • rimage - (optional) image to display on right side of box

Layout

[edit]
for layout, see Template:Color number/data and Template:Color number/layout
  • The following parameters are passed to data:
    • 1 - color QID
    • 2 - color category name
    • 3 - number
    • lang - language code from autotranslate
    • rimage - image name from page
  • The following parameters are gathered by data and passed to layout:
    • clabel - color WD label
    • ccat - color category name
    • cimage - color image (WD) (P18)
    • crgb - sRGB color hex triplet (WD) (P465)
    • n - number
    • lang - language code to use in WD queries
    • rimage - directly passed from page

Localization

[edit]

Use the following template for new language templates (e.g. Template:Color number/en):

<includeonly>{{Color number/data|{{{1}}}|{{{2}}}|{{{3}}}|di={{{di|}}}|ui={{{ui|}}}|lang=<!--
Insert desired language code here -->  <!--
(comment code may be removed if desired)
-->|rimage={{{rimage|}}}}}</includeonly><noinclude>
{{translated tag|header}}
</no include>