User:Sunmarsh/Sandbox
Working on a Template:ItemList revamp to make it easier to use.
Template:TableHeader
This template will create a collapsible container for the item table and will generate the table header (table title and column names). This template accepts various parameters which determine the type of list to be created.
<!-- This first section of code checks to see if the list to be created needs to be enclosed in a collapsible container or not. Only matching wallpaper or flooring that is to be embedded in a series or theme list will be generated without a collapsible div container. There are also several #switch parser functions which change the color of the table if it is of the fish, insect, or seafood type.--> {{#switch:{{{collection|}}} | series | theme = {{#switch:{{{type|}}} | wallpaper | flooring = {{(!}} class="sortable align="center" width="100%" cellspacing="0px" cellpadding="1px" style="background:#FFDD66; text-align:center; border: 4px solid #FFDD66; {{roundy}}"}} | <div class="mw-collapsible {{#ifeq: "{{{collapsed|false}}}" | "true" | mw-collapsed | }}" style="margin:auto; width:80%; background:#FFDD66; border: 4px solid #FFDD66; text-align:center; {{roundy}}"> '''{{{title|Please enter a title.}}}''' <div class="mw-collapsible-content"> {{(!}} class="sortable align="center" width="100%" cellspacing="0px" cellpadding="1px" style="background:#{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 4F9FC6 | FFDD66}}; text-align:center; border: 4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; {{roundy}}"}} <!--This code creates the heading text for the first column which is identical for all tables except for those of the bug, insect, music, and seafood type.--> ! style="{{roundyleft}}" {{!}} {{#switch:{{{type|}}} | fish | insect | seafood = # | music = Song Title | Item}} ! style="border-bottom:4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-right: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-left: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; background-color:#{{#switch:{{{type|}}} | fish = 66CCFF | insect = 9acd32 | seafood = 66a6ff | FFFFCC}}; color:#666;" {{!}} {{#switch:{{{type|}}} | fish | insect | seafood = Name | music = {{#switch:{{{game|}}} | ACNL = Image | Listen}} | Image}} ! style="border-bottom:4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-right: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-left: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; background-color:#{{#switch:{{{type|}}} | fish = 66CCFF | insect = 9acd32 | seafood = 66a6ff | FFFFCC}}; color:#666;" {{!}} {{#switch:{{{collection|}}} | other = {{#switch:{{{type|}}} | fish | insect | seafood = Image | music = {{#switch:{{{game|}}} | ACNL = Listen}} | Buy Price}} | Buy Price}} ! style="border-bottom:4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-right: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-left: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; background-color:#{{#switch:{{{type|}}} | fish = 66CCFF | insect = 9acd32 | seafood = 66a6ff | FFFFCC}}; color:#666;" {{!}} {{#switch:{{{collection|}}} | other = {{#switch:{{{type|}}} | fish | insect | seafood = Price | music = {{#switch:{{{game|}}} | ACNL = Buy Price}} | wallpaper | carpet = Match | Buy Price}} | Sell Price}} ! style="border-bottom:4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-right: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-left: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; background-color:#{{#switch:{{{type|}}} | fish = 66CCFF | insect = 9acd32 | seafood = 66a6ff | FFFFCC}}; color:#666;" {{!}} {{#switch:{{{collection|}}} | category | series | set | theme = Available From | {{#switch:{{{type|}}} | fish | insect = Location | seafood = Size | music = {{#switch:{{{game|}}} | ACNL = Listen}} | wallpaper | carpet = Match | Buy Price}}}} ! style="border-bottom:4px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-right: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; border-left: 2px solid #{{#switch:{{{type|}}} | fish = 4F9FC6 | insect = 8BB95A | seafood = 66a6ff | FFDD66}}; background-color:#{{#switch:{{{type|}}} | fish = 66CCFF | insect = 9acd32 | seafood = 66a6ff | FFFFCC}}; color:#666;" {{!}} {{#switch:{{{collection|}}} | category | series | set | theme = {{#switch:{{{game|}}} | ACCF | ACNL = Color(s) | Group}} | {{#switch:{{{type|}}} | fish | insect | seafood = Price | music = {{#switch:{{{game|}}} | ACNL = Listen}} | wallpaper | carpet = Match | Buy Price}}}}
Parameters
All parameters are required unless otherwise noted.
- title - The table heading text.
- collapsed - Optional. Will cause the table to appear collapsed by default. Accepts a true or false value; default value is false.
- game - Enter the appropriate abbreviation to display an item table with headings corresponding to that AC title. Acceptable values listed below.
- type - The type of item you're creating a list for (e.g. furniture, wallpaper, clothing, accessories etc.). Acceptable values listed below.
- collection - The type of item grouping you're creating a list for (e.g. series, theme, set etc.). Acceptable values listed below.
|
|
|