Template:CatWeight: Difference between revisions

From AniDB
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#switch: {{#if: {{{3|}}} | {{{1}}} | }}
<!-- Technically CatWeight turned out to be a special one row case of CatWeightTable --><includeonly>{{#if: {{{4|}}}  
| 1 = :
| {{CatWeightTable|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}}}
| 2 = ::
| {{CatWeightTable|0|{{{1}}}|{{{2}}}|{{{3}}}}}  
| 3 = :::
}}</includeonly><noinclude>{{{{PAGENAME}}/doc}}[[Category:Category Weight]]</noinclude>
| 4 = ::::
| 5 = :::::
| 6 = ::::::
|
}}{| style="background:#FAF0FF; border:1px solid #DFC8EC;"
| style="background:black; padding-bottom:2px; padding-left:8px; padding-right:8px; white-space:nowrap;" | <span style="color:white; font-weight:bold;">Category Weight</span>
| style="background:#DFC8EC; padding-bottom:2px; padding-left:8px; padding-right:8px; width:200px; white-space:nowrap;" | <span style="color:black; font-weight:bold;"><tt>{{#switch: {{#if: {{{3|}}} | {{{2}}} | {{{1}}} }}
| 1 = +&nbsp;&nbsp;
| 2 = &#42;&nbsp;&nbsp;
| 3 = &#42;+&nbsp;
| 4 = &#42;&#42;&nbsp;
| 5 = &#42;&#42;+
| 6 = &#42;&#42;&#42;
| &nbsp;&nbsp;&nbsp;
}}</tt></span>
| style="padding: 2px; width: 100%;" | ''{{#if: {{{3|}}} | {{{3}}} | {{{2}}}}}''
|}<noinclude>{{ {{TALKPAGENAME}} }}[[Category:Template]]</noinclude>

Latest revision as of 21:47, 5 May 2009

This template creates an category weight bar that can be indented up to six times via parameter value. It can also be colour coded, a weight can be defined, and you can add a message describing the weight choice.

Features Indentation of up to 6 levels, colours, and weight ranges.

Syntax

The template can have 3 or 4 parameters:

  1. {{catWeight|<colour>|<weight>|<text>}} - Default mode, no indentation.
  2. {{catWeight|<#>|<colour>|<weight>|<text>}} - Define indentation via <#> parameter.
       <#> =  Number 0 (min) to 6 (max), defines indentation level.

  <colour> =  Define the colour type of the info box:
                 onoff      = yellow-ish... use to match {{catWeightInfo|onoff}}
                 worstcase  = red-ish... use to match {{catWeightInfo|worstcase}}
                 amount     = green-ish... use to match {{catWeightInfo|amount}}
                 misc       = purple-ish... (fun, testing), the default colour!
              For the most current list of available <colour>s, see CatWcolBackground 
              or CatWcolFrame template.  

  <weight> =  The category weight denominator (not word-wrapped), range:
                 1 for "+"  to  6 for "***"
                 1-5 for "+ to **+"
                 1-6 for "+ to ***"
              For a complete list of available <weight>s (and ranges), see the CatWweight template.

    <text> =  The descriptive text for that weight level.

  <weight> =  The category weight denominator (not word-wrapped), range:
   <w>          1 for "+"  to  6 for "***"
                1-5 for "+ to **+"
                1-6 for "+ to ***"

Examples

The Weights

Category Weight     Weight "emtpy" for <color> = misc, <weight> = 0.
Category Weight +   Weight + for <color> = amount, <weight> = 1.
Category Weight *   Weight * for <color> = worstcase, <weight> = 2.
Category Weight *+  Weight *+ for <color> = onoff, <weight> = 3.
Category Weight **  Weight ** for <color> = blue, <weight> = 4.
Category Weight **+ Weight **+ for <color> = misc, <weight> = 5.
Category Weight *** Weight *** for <weight> = 6.
Category Weight + to **+ Weight + to **+ for <weight> = 1-5.
Category Weight + to *** Weight + to *** for <weight> = 1-6.

Indentation

{{catWeight|0|onoff|0|'''No''' indentation or weight.}} 
Category Weight     No indentation or weight.
{{catWeight|1|worstcase|1|'''One''' indentation and weight.}} 
Category Weight +   One indentation and weight.
{{catWeight|2|amount|2|Level '''two''' indentation and weight!}} 
Category Weight *   Level two indentation and weight!
{{catWeight|6|misc|6|Maximum indentation level of '''six''', same weight!}} 
Category Weight *** Maximum indentation level of six, same weight!

Test the Code

Should more code testing be required see the Template:CatWeight/Test Code page.