Difference between revisions of "Template:VendorTableHeader"

From Space Station 13 Wiki
Jump to navigation Jump to search
(Transclude documentation. Will update name once I decide to move it)
m (Assign to Decorative Templates category, since it has a similar role to the Location and Job templates. I was planning to add it in after moving it into Template space, so I can't believe I almost forgot assign a category.)
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:
! scope="col" | Item
! scope="col" | Item
{{#switch: {{{Add Price Column?}}} | Yes= ! scope="col" {{!}} Price}}
{{#switch: {{{Add Price Column?}}} | Yes= ! scope="col" {{!}} Price}}
! scope="col"| [[Hacking#Vending Machines and Fabricators|Hidden<br>item?]]</includeonly><noinclude>{{User:Studenterhue/Template:VendorTableHeader/Documentation}}</noinclude>
! scope="col"| [[Hacking#Vending Machines and Fabricators|Hidden<br>item?]]</includeonly><noinclude>{{Template:VendorTableHeader/Documentation}} [[Category:Decorative Templates]]</noinclude>

Latest revision as of 07:35, 29 July 2023

This template is used to document the contents of vending machines. It automatically creates a wikitable-style table header that contains columns labeled "Icon", "Quantity", "Item", "Price" (if toggled on), and "Hidden Item?", with every column except Icon being sortable. This table is collapsible but starts open by default, and when collapsed, it shows "List of Contents" with a [Expand] link.

This is meant to be used alongside Template:VendorTableRow. That template creates row for each item inside a vendor and shows the vendor's actual contents, while this template provides the header for sorting. This allows people to sort by price, name, and more, something that is not possible with a bulleted list.

Usage

With Price Column

{{VendorTableHeader|Add Price Column?=Yes}}

(insert VendorTableRow templates here)

|}

Without Price Column

{{VendorTableHeader}}

(insert VendorTableRow templates here)

|}

Parameters

This template has only one parameter: Add Price Column? It's pretty self-explanatory. If the vendor makes you pay to get items, then the table showing its contents needs to have a column for prices. That means you should put Yes (it's case-sensitive, so yes won't do) for this template's parameter. If the vending machine doesn't require money, you can just omit this entirely.

Be forewarned: this template does not add the table end markup (|}). If you aren't copying and pasting the samples above, you need to add it after the template!