Template:ShopItem: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
(new rupee template order)
(changed quantity parameter to be instandard with Template:Qty)
 
(47 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Deprecated|[[Template:Wares]]}}
{{ShopItem/h}}
{{ShopItem/h}}
{{ShopItem|Bomb|10|1|TLoZ|Sprite}}
{{ShopItem|TLoZ|Bomb|10}}
{{ShopItem/f}}
|}


<includeonly><onlyinclude>|-
<includeonly><onlyinclude>|-
| {{Key|{{{item|{{{1|}}}}}} {{#if: {{{quantity|{{{3|}}}}}} | ({{{quantity|{{{3|}}}}}}) | }}}} {{#if: {{{altimg|{{{7|}}}}}} | [[File:{{{altimg|{{{7|}}}}}}|x32px]] | [[File:{{#if: {{{altgame|{{{8|}}}}}} | {{{altgame|{{{8|}}}}}} | {{{game|{{{4|}}}}}} }} {{{item|{{{1|}}}}}} {{{typeimg|{{{5|}}}}}}.png|x32px]]}}<br>'''{{#if: {{{altname|{{{6|}}}}}} | [[{{{item|{{{1|}}}}}}|{{{altname|{{{6|}}}}}}]] {{#ifexpr: {{{quantity|{{{3|}}}}}} > 1 | ({{{quantity|{{{3|}}}}}}) | }} | [[{{{item|{{{1|}}}}}}]] {{#ifexpr: {{{quantity|{{{3|}}}}}} > 1 | ({{{quantity|{{{3|}}}}}}) | }}}}'''
| data-sort-value="{{{2|}}} ×{{{quantity|1}}}" style="text-align:center" | {{#ifeq: {{lc:{{{img|}}}}} | none || {{#if:{{{img|}}}|[[File:{{{img}}}|x32px]]|{{#invoke:File|Icon|{{{1}}}|{{{2|}}}|size=x32px}}}}<br>}}'''{{Term|{{{1}}}|{{{2}}}|link|display={{{dispname|}}}}}''' {{#ifexpr: {{{quantity|1}}} > 1 | ×{{{quantity|0}}} }} {{#if: {{{note|}}} | {{Exp|{{{note|}}} }} }} {{#if: {{{stock|}}} | {{Exp|Only {{{stock|}}} in stock}} }}
| {{#ifeq: {{{price|{{{2|}}}}}} | NA | '''N/A''' | data-sort-value={{{price|{{{2|}}}}}}{{!}} {{Rupee|{{{game|{{{4|}}}}}}|{{{price|{{{2|}}}}}}}}}}{{#if: {{{price2|{{{9|}}}}}} | {{!}}{{!}}{{#ifeq: {{{price2|{{{9|}}}}}} | NA | '''N/A''' | data-sort-value={{{price2|{{{9|}}}}}}{{!}} {{Rupee|{{{game|{{{4|}}}}}}|{{{price2|{{{9|}}}}}}}}}}}}{{#if: {{{price3|{{{10|}}}}}} | {{!}}{{!}}{{#ifeq: {{{price3|{{{10|}}}}}} | NA | '''N/A''' | data-sort-value={{{price3|{{{10|}}}}}}{{!}} {{Rupee|{{{game|{{{4|}}}}}}|{{{price3|{{{10|}}}}}}}}}}}}{{#if: {{{price4|{{{11|}}}}}} | {{!}}{{!}}{{#ifeq: {{{price4|{{{11|}}}}}} | NA | '''N/A''' | data-sort-value={{{price4|{{{11|}}}}}}{{!}} {{Rupee|{{{game|{{{4|}}}}}}|{{{price4|{{{11|}}}}}}}}}}}}</onlyinclude></includeonly>
{{#if: {{{desc|}}} | {{!}} ''{{{desc|{{{6|}}}}}}''}}
| data-sort-value={{{3|N/A}}} | {{#iferror: {{#expr: 1 + {{formatnum:{{{3|N/A}}}|R}} }} | '''{{{3|N/A}}}''' | {{Rupee|{{{1|}}}|{{{3|0}}}}} }}
{{#if: {{{4|}}} |{{!}} data-sort-value{{=}}{{{4}}} {{!}} {{#iferror: {{#expr: 1 + {{formatnum:{{{4|N/A}}}|R}} }} | '''{{{4|N/A}}}''' | {{Rupee|{{{1|}}}|{{{4|0}}}}} }}
{{#if: {{{5|}}} |{{!}} data-sort-value{{=}}{{{5}}} {{!}} {{#iferror: {{#expr: 1 + {{formatnum:{{{5|N/A}}}|R}} }} | '''{{{5|N/A}}}''' | {{Rupee|{{{1|}}}|{{{5|0}}}}} }}
{{#if: {{{6|}}} |{{!}} data-sort-value{{=}}{{{6}}} {{!}} {{#iferror: {{#expr: 1 + {{formatnum:{{{6|N/A}}}|R}} }} | '''{{{6|N/A}}}''' | {{Rupee|{{{1|}}}|{{{6|0}}}}} }} }} }} }}</onlyinclude></includeonly>


==Purpose==
==Purpose==
Line 11: Line 17:


==Usage==
==Usage==
{{NoWikiTemp|Normal|item|price|quantity|game|typeimg|altname|altimg|altgame|price2|price3|price4}}
{{NoWikiTemp|Normal|game|item|price|price2|price3|price4|quantity|stock|desc|dispname|note|img|altlink}}
{{Parameter|item|The item sold.|Required}}
{{Parameter|game|The game's abbreviation|Required}}
{{Parameter|price|The item's price.|Required}}
{{Parameter|item|The item sold|Required}}
{{Parameter|quantity|Quantity of item sold.|Required}}
{{Parameter|price|The item's price|Required}}
{{Parameter|game|The game's abbreviation.|Required}}
{{Parameter|price2|The item's price for the second column (requires a table with multiple columns)|Optional}}
{{Parameter|typeimg|The type of image to get of the item. (Ex: Sprite, Icon, Model)|Required}}
{{Parameter|price3|The item's price for the third column (requires a table with multiple columns)|Optional}}
{{Parameter|altname|For naming the item something else than its actual name.|Optional}}
{{Parameter|price4|The item's price for the fourth column (requires a table with multiple columns)|Optional}}
{{Parameter|altimg|For using an alternative image than the currently formatted one.|Optional}}
{{Parameter|quantity|Quantity of item sold.|Optional}}
{{Parameter|altgame|For fetching the image from an alternative game.|Optional}}
{{Parameter|stock|The maximum amount of the item available in the shop.|Optional}}
{{Parameter|price2|The item's price for the second column. (Requires a table with multiple columns)|Optional}}
{{Parameter|desc|The item's description from the in-game shop (requires "desc" parameter to be enabled in "ShopItem/h")|Optional}}
{{Parameter|price3|The item's price for the third column. (Requires a table with multiple columns)|Optional}}
{{Parameter|dispname|Display name of the item (<code>item</code> is still used to determine link and image)|Optional}}
{{Parameter|price4|The item's price for the fourth column. (Requires a table with multiple columns)|Optional}}
{{Parameter|note|For adding a note next to the item's name|Optional}}
{{Parameter|img|Overrides image with image at specified filename. Setting this value to "None" (case insensitive) causes no image to be displayed.|Optional}}


Note: This template must be enclosed between a {{tl|ShopItem/h}} and a {{tl|ShopItem/f}} template. (See example code below)
Note: This template must have a {{Template|ShopItem/h}} header to function properly (see example code below).


==Examples==
==Examples==
===Basic===
===Basic===
How to use a Sprite, an Icon, a Model or an Artwork.
How to use a Sprite, an Icon, a Model or an Artwork.
<pre>
{{ShopItem/h}}
{{ShopItem|TLoZ|Bomb|100}}
{{ShopItem|MM3D|Bomb|100}}
{{ShopItem|TP|Bomb|100}}
{{ShopItem|ALttP|Bomb|100}}
|}
</pre>
{{ShopItem/h}}
{{ShopItem/h}}
{{ShopItem|Bomb|100|1|TLoZ|Sprite}}
{{ShopItem|TLoZ|Bomb|100}}
{{ShopItem|Bomb|100|1|MM3D|Icon}}
{{ShopItem|MM3D|Bomb|100}}
{{ShopItem|Bomb|100|1|TP|Model}}
{{ShopItem|TP|Bomb|100}}
{{ShopItem|Bomb|100|1|ALttP|Artwork}}
{{ShopItem|ALttP|Bomb|100}}
{{ShopItem/f}}
|}


===Alternative Link Name===
===Alternative Display Name, Stock and Note===
For when the shop sells an item with a different name than the actual item name itself. This is also useful when adding plural.
For when the shop sells an item with a different shop name to the item's article title. This is useful when the item name should be in plural.
<pre>
{{ShopItem/h}}
{{ShopItem/h}}
{{ShopItem|Bomb|100|1|TLoZ|Sprite}}
{{ShopItem|TLoZ|Bomb|100|stock=3}}
{{ShopItem|Bomb|100|10|TLoZ|Sprite|Bombs}}
{{ShopItem|TLoZ|Bomb|100|note=This is a note}}
{{ShopItem|Bomb|100|1|TLoZ|Sprite|Cool Bomb}}
{{ShopItem|TLoZ|Bomb|100|quantity=10|dispname=Bombs}}
{{ShopItem/f}}
{{ShopItem|TLoZ|Bomb|100|dispname=Cool Bomb}}
|}
</pre>
{{ShopItem/h}}
{{ShopItem|TLoZ|Bomb|100|stock=3}}
{{ShopItem|TLoZ|Bomb|100|note=This is a note}}
{{ShopItem|TLoZ|Bomb|100|quantity=10|dispname=Bombs}}
{{ShopItem|TLoZ|Bomb|100|dispname=Cool Bomb}}
|}


===Alternative Image===
===Alternative Image===
For when adding a different image is needed. Although this is possible, it is not recommended, you should move the wanted file to the good format.
For when the item's image does not match the systematic filename yielded by the template. Although this is possible, it should only be done if the item is already uses the recommended filename structure and that name is incompatible with this template. It is also possible to use no image at all by assigning the "img" parameter the value of "NONE" (case insensitive).
<pre>
{{ShopItem/h}}
{{ShopItem/h}}
{{ShopItem|Bomb|100|1|ALttP|Sprite||Bombs ALttP.png}}
{{ShopItem|ALttP|Bomb|100|img=ALttP Bomb Artwork 2.png}}
{{ShopItem/f}}
{{ShopItem|ALttP|Bomb|100|img=none}}
 
{{ShopItem|OoT3D|Bomb|100|img=MM3D Bomb Icon.png}}
===Alternative Game===
{{ShopItem|MM3D|Bomb|100}}
For when the image's game is not the same as the rupee corresponding to the game's shop. (Ex: OoT and MM sharing the same ressources)
|}
</pre>
{{ShopItem/h}}
{{ShopItem/h}}
{{ShopItem|Bomb|100|1|OoT3D|Icon|||MM3D}}
{{ShopItem|ALttP|Bomb|100|img=ALttP Bomb Artwork 2.png}}
{{ShopItem|Bomb|100|1|MM3D|Icon}}
{{ShopItem|ALttP|Bomb|100|img=none}}
{{ShopItem/f}}
{{ShopItem|OoT3D|Bomb|100|img=MM3D Bomb Icon.png}}
{{ShopItem|MM3D|Bomb|100}}
|}


===Multiple Columns & N/A Price===
===Multiple Columns & N/A Price===
For creating tables with multiple types of prices and including items that can't be sold for some.
For creating tables with multiple types of prices and including items that can't be sold for some or prices that varies.
<pre>
{{ShopItem/h|3|Regular|Discount #1|Discount #2}}
{{ShopItem/h|3|Regular|Discount #1|Discount #2}}
{{ShopItem|Bomb|NA|1|TLoZ|Sprite||||105|NA}}
{{ShopItem|TLoZ|Bomb|N/A|105|35}}
{{ShopItem|Bomb|50|1|TLoZ|Sprite||||NA|65}}
{{ShopItem|TLoZ|Bomb|50|80|65}}
{{ShopItem/f}}
{{ShopItem|TLoZ|Bomb|40|N/A|N/A}}
{{ShopItem|TLoZ|Bomb|N/A|10|35}}
|}
</pre>
{{ShopItem/h|3|Regular|Discount #1|Discount #2}}
{{ShopItem|TLoZ|Bomb|N/A|105|35}}
{{ShopItem|TLoZ|Bomb|50|80|65}}
{{ShopItem|TLoZ|Bomb|40|N/A|N/A}}
{{ShopItem|TLoZ|Bomb|N/A|10|35}}
|}
 
===Descriptions===
For adding descriptions to an item.
<pre>
{{ShopItem/h|3|Regular|Discount #1|Discount #2|desc=yes}}
{{ShopItem|TLoZ|Bomb|desc=This is a Bomb.|N/A|105|N/A}}
|}
</pre>
{{ShopItem/h|3|Regular|Discount #1|Discount #2|desc=yes}}
{{ShopItem|TLoZ|Bomb|desc=This is a Bomb.|N/A|105|N/A}}
|}
<noinclude>[[Category:Table templates]]</noinclude>

Latest revision as of 13:35, 23 April 2024

This template has been deprecated.
Please use Template:Wares instead.
Item Price

Bomb


Purpose

A template for creating tables for items sold in shops.

Usage

    {{ShopItem|game |item |price |price2 |price3 |price4 |quantity |stock |desc |dispname |note |img |altlink }}

  • game — The game's abbreviation
  • item — The item sold
  • price — The item's price
  • price2 — The item's price for the second column (requires a table with multiple columns)
  • price3 — The item's price for the third column (requires a table with multiple columns)
  • price4 — The item's price for the fourth column (requires a table with multiple columns)
  • quantity — Quantity of item sold.
  • stock — The maximum amount of the item available in the shop.
  • desc — The item's description from the in-game shop (requires "desc" parameter to be enabled in "ShopItem/h")
  • dispname — Display name of the item (item is still used to determine link and image)
  • note — For adding a note next to the item's name
  • img — Overrides image with image at specified filename. Setting this value to "None" (case insensitive) causes no image to be displayed.

Note: This template must have a {{ShopItem/h}} header to function properly (see example code below).

Examples

Basic

How to use a Sprite, an Icon, a Model or an Artwork.

{{ShopItem/h}}
{{ShopItem|TLoZ|Bomb|100}}
{{ShopItem|MM3D|Bomb|100}}
{{ShopItem|TP|Bomb|100}}
{{ShopItem|ALttP|Bomb|100}}
|}
Item Price

Bomb
100 Rupees

Bomb
100 Rupees

Bomb
100 Rupees

Bomb
100 Rupees

Alternative Display Name, Stock and Note

For when the shop sells an item with a different shop name to the item's article title. This is useful when the item name should be in plural.

{{ShopItem/h}}
{{ShopItem|TLoZ|Bomb|100|stock=3}}
{{ShopItem|TLoZ|Bomb|100|note=This is a note}}
{{ShopItem|TLoZ|Bomb|100|quantity=10|dispname=Bombs}}
{{ShopItem|TLoZ|Bomb|100|dispname=Cool Bomb}}
|}
Item Price

Bomb
100 Rupees

Bomb
100 Rupees

Bombs ×10
100 Rupees

Cool Bomb
100 Rupees

Alternative Image

For when the item's image does not match the systematic filename yielded by the template. Although this is possible, it should only be done if the item is already uses the recommended filename structure and that name is incompatible with this template. It is also possible to use no image at all by assigning the "img" parameter the value of "NONE" (case insensitive).

{{ShopItem/h}}
{{ShopItem|ALttP|Bomb|100|img=ALttP Bomb Artwork 2.png}}
{{ShopItem|ALttP|Bomb|100|img=none}}
{{ShopItem|OoT3D|Bomb|100|img=MM3D Bomb Icon.png}}
{{ShopItem|MM3D|Bomb|100}}
|}
Item Price

Bomb
100 Rupees
Bomb
100 Rupees

Bomb
100 Rupees

Bomb
100 Rupees

Multiple Columns & N/A Price

For creating tables with multiple types of prices and including items that can't be sold for some or prices that varies.

{{ShopItem/h|3|Regular|Discount #1|Discount #2}}
{{ShopItem|TLoZ|Bomb|N/A|105|35}}
{{ShopItem|TLoZ|Bomb|50|80|65}}
{{ShopItem|TLoZ|Bomb|40|N/A|N/A}}
{{ShopItem|TLoZ|Bomb|N/A|10|35}}
|}
Item Prices
Regular Discount #1 Discount #2

Bomb
N/A
105 Rupees

Bomb

Bomb
N/A N/A

Bomb
N/A

Descriptions

For adding descriptions to an item.

{{ShopItem/h|3|Regular|Discount #1|Discount #2|desc=yes}}
{{ShopItem|TLoZ|Bomb|desc=This is a Bomb.|N/A|105|N/A}}
|}
Item Description Prices
Regular Discount #1 Discount #2

Bomb
This is a Bomb. N/A
105 Rupees
N/A