Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Item Infobox: Difference between revisions

Template page
No edit summary
No edit summary
Line 1: Line 1:
{| class="infobox" style="float:right; width:250px; border: 1px solid #aaaaaa; padding: 0.2em; margin-left: 1em; margin-bottom: 0.5em; background-color: #f9f9f9;"
<!-- Template:Item Infobox -->
|+ style="font-size: 1.2em; font-weight: bold; padding-bottom: 0.3em;" | {{{name|{{PAGENAME}}}}}
<!-- Uses the generic Template:Infobox to display item information -->
{{#if: {{{image|}}} | <!-- Check if image parameter is provided -->
<includeonly>{{Infobox
|- <!-- Start a new row specifically for the image -->
| bodyclass= mw-collapsible floatright <!-- Standard class from your example -->
| colspan="2" style="text-align:center;" | [[File:{{{image}}}|{{{imagesize|200px}}}]] <!-- Image cell using '|', spanning 2 columns -->
| image1 = {{#if:{{{image|}}}|[[File:{{{image}}}|{{{imagesize|200px}}}]]|[[File:Placeholderv2.png|200px]]}} <!-- Use provided image or placeholder, default size 200px -->
}} <!-- End image conditional -->
| imagerowclass1 = infobox-image <!-- Assign class to image row -->
{{#if: {{{introduced|}}} | <!-- Check if introduced parameter is provided -->
 
|- <!-- Start a new row -->
| header1 = {{#if:{{{name|}}}|{{Infobox title icon|{{{name|{{PAGENAME}}}}}|icon={{{icon|Item}}} }} }} <!-- Display name, default icon 'Item' -->
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Introduced <!-- Label cell (using '!') -->
| rowclass1 = infobox-title <!-- Assign class to title row -->
| style="padding-left:0.5em;" | {{{introduced}}} <!-- Value cell (using '|') -->
 
}} <!-- End introduced conditional -->
| label2 = Introduced <!-- Row 2: Label -->
{{#if: {{{type|}}} |
| data2 = {{{introduced|}}} <!-- Row 2: Data from 'introduced' parameter -->
|-
| rowclass2 = data-introduced infobox-data infobox-col1 <!-- Assign classes (adjust col1/col2 as needed for your layout) -->
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Type
 
| style="padding-left:0.5em;" | {{{type}}}
| label3 = Type <!-- Row 3: Label -->
}}
| data3 = {{{type|}}} <!-- Row 3: Data from 'type' parameter -->
{{#if: {{{category|}}} |
| rowclass3 = data-type infobox-data infobox-col2 <!-- Assign classes -->
|-
 
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Category
| label4 = Category <!-- Row 4: Label -->
| style="padding-left:0.5em;" | {{{category}}}
| data4 = {{{category|}}} <!-- Row 4: Data from 'category' parameter -->
}}
| rowclass4 = data-category infobox-data infobox-col1 <!-- Assign classes -->
{{#if: {{{vendor|}}} |
 
|-
| label5 = Vendor <!-- Row 5: Label -->
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Vendor
| data5 = {{{vendor|}}} <!-- Row 5: Data from 'vendor' parameter -->
| style="padding-left:0.5em;" | {{{vendor}}}
| rowclass5 = data-vendor infobox-data infobox-col2 <!-- Assign classes -->
}}
 
{{#if: {{{dyeable|}}} |
| label6 = Dyeable <!-- Row 6: Label -->
|-
| data6 = {{{dyeable|}}} <!-- Row 6: Data from 'dyeable' parameter -->
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Dyeable
| rowclass6 = data-dyeable infobox-data infobox-col1 <!-- Assign classes -->
| style="padding-left:0.5em;" | {{{dyeable}}}
 
}}
| label7 = Access <!-- Row 7: Label -->
{{#if: {{{access|}}} |
| data7 = {{{access|}}} <!-- Row 7: Data from 'access' parameter -->
|-
| rowclass7 = data-access infobox-data infobox-col2 <!-- Assign classes -->
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Access
 
| style="padding-left:0.5em;" | {{{access}}}
| label8 = Use Location <!-- Row 8: Label -->
}}
| data8 = {{{use_location|}}} <!-- Row 8: Data from 'use_location' parameter -->
{{#if: {{{use_location|}}} |
| rowclass8 = data-uselocation infobox-data infobox-col1 <!-- Assign classes -->
|-
 
! scope="row" style="text-align:left; padding-left:0.5em; background-color:#eef;" | Use Location
<!-- Add more rows if needed by incrementing numbers: label9, data9, rowclass9, etc. -->
| style="padding-left:0.5em;" | {{{use_location}}}
 
}}
<!-- Optional Button Bar - Adapt if items need specific links -->
<!-- Add more parameters as needed using the same structure -->
<!--
|}
| header21 = {{#if:{{{some_item_link|}}}|{{Infobox buttons|type=item|someurl={{{some_item_link|}}}}}|<span></span>}}
<noinclude>
| rowclass21 = infobox-button-bar
-->
}}</includeonly><!--
 
Optional Short description for items
--><includeonly>{{Short description|Game item in Outlands}}</includeonly><!--
 
Categorization
--><noinclude>
[[Category:Infobox Templates]]
[[Category:Infobox Templates]]
<!-- Add documentation here -->
[[Category:Item Templates]] <!-- Or a more specific category -->
This template creates a standard item infobox.


'''Parameters:'''
== Usage ==
* name: Item name (defaults to page name)
This template creates an infobox for game items by using the generic [[Template:Infobox]].
* image: Filename of the item image
 
* imagesize: Size for the image (defaults to 200px)
<pre>
* introduced: Patch or date introduced
{{Item Infobox
* type: Item type (e.g., Container, Weapon)
| name = Item Name (defaults to page name if omitted)
* category: Vendor category (e.g., Misc, Reagents)
| image = ItemImage.png (defaults to Placeholderv2.png if omitted)
* vendor: NPC or source selling the item
| imagesize = 250px <!-- Optional, defaults to 200px -->
* dyeable: Is the item dyeable? (e.g., Yes, No, specific dye type)
| icon = OptionalIconName <!-- Optional, for title bar, defaults to 'Item' -->
* access: Who can use/access it? (e.g., Owner Only, Public)
| introduced = [[Patch Name]] or Date
* use_location: Where must it be to function? (e.g., Secured in House)
| type = Item Type (e.g., Container, Weapon)
* Add custom parameters as needed...
| category = Vendor Category (e.g., Misc)
| vendor = [[Vendor Name]]
| dyeable = Yes / No / [[Dye Type]]
| access = Access restrictions (e.g., House Co-Owners Only)
| use_location = Required location (e.g., Secured in House)
<!-- Add any other parameters you define here -->
}}
</pre>
</noinclude>
</noinclude>

Revision as of 06:01, 4 April 2025


Usage

This template creates an infobox for game items by using the generic Template:Infobox.

{{Item Infobox
| name = Item Name (defaults to page name if omitted)
| image = ItemImage.png (defaults to Placeholderv2.png if omitted)
| imagesize = 250px <!-- Optional, defaults to 200px -->
| icon = OptionalIconName <!-- Optional, for title bar, defaults to 'Item' -->
| introduced = [[Patch Name]] or Date
| type = Item Type (e.g., Container, Weapon)
| category = Vendor Category (e.g., Misc)
| vendor = [[Vendor Name]]
| dyeable = Yes / No / [[Dye Type]]
| access = Access restrictions (e.g., House Co-Owners Only)
| use_location = Required location (e.g., Secured in House)
<!-- Add any other parameters you define here -->
}}
Contents