Template:Buckets
This template is for illustrating structured categories. It generates a nested set structure and styles it as a css grid that renders horizontally on wider screens but on narrower screens automatically collapses into a single column list.
Usage
[edit source]Buckets consist of pairs of values, a category label followed by content for that category. Multiple pairs can be included in the same template.
{{Buckets
|Fish
|Salmon, Tuna, Cod
|Whales
|Blue whale, Orca, Dolphin
}}
creates
(whitespace is for ease of reading and not functionally necessary). Buckets can be nested to show subgroups.
{{Buckets
|Sea creatures
|{{Buckets
|Fish
|Salmon, Tuna, Cod
|Whales
|Blue whale, Orca, Dolphin
}}
|Land creatures
|Dog, cat, elephant
}}
creates
It is possible to use wikicode and other templates within a Buckets content, e.g. {{hlist}}.
It is also possible to manually adjust styles for labels using |stylen=, where n corresponds to the number of the label or content box you want to modify.
{{Buckets
|Sea creatures
|{{Buckets
|style1=background-color:seagreen;
|Fish
|style2=background-color:cornflowerblue;
|Salmon, Tuna, Cod
|Whales
|Blue whale, Orca, Dolphin
}}
|style3=text-decoration:underline;|Land creatures
|Dog, cat, elephant
}}
On narrow screens, the horizontal structure automatically collapses into a vertical structure and automatic colour coding helps distinguish levels of nesting.
Limits
[edit source]Conceptual
[edit source]Buckets can illustrate subsets but not intersections. That is, something can be contained by its parents and grandparent categories but not shared between two different parent sets, and all of its siblings must also appear in the same set. This means it is not suitable for illustrating all real life relationships--it's just a crude approximation. That's why it's called "Buckets"!
So, to add a creature like a seal, both a land and a sea creature, to these buckets, you would either need to add it to both the land creatures and sea creatures buckets, or make a new bucket for land-and-sea creatures.
Technological
[edit source]Very high levels of nesting could run into the expansion depth limit. The template is likely to be impractical before that occurs however.