Template:Chest: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (Add category 2)
(Updated documentation)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><div class="mw-collapsible mw-collapsed" data-expandtext="Show Contents" data-collapsetext="Hide Contents" style="{{#if:{{{nograd|}}} | background:transparent; | background: linear-gradient(to right, #252f42, #232323, #232323, #232323); align-items:center; border-radius:10px; padding: 5px;}}">
<includeonly><div class="mw-collapsible mw-collapsed" data-expandtext="Show Contents" data-collapsetext="Hide Contents" style="{{#if:{{{nograd|}}} | background:transparent; | background: linear-gradient(to right, #252f42, #232323, #232323, #232323); align-items:center; border-radius:10px; padding: 5px;}}">


[[File:{{{icon|Concentration Icons.png}}}|32px|link={{{link|}}}]] '''{{#if:{{{title_override|}}}|{{{title_override|}}}|[[{{{link|Items}}}|{{{link|This chest}}}]] {{#if:{{{DC|}}}|with the [[Difficulty Class|DC {{{DC|}}}]] to lockpick|}} }} contains the following items:'''
[[File:{{{icon|Concentration Icons.png}}}|24px|link={{{link|}}}]] '''{{#if:{{{title_override|}}}|{{{title_override|}}}|[[{{{link|Items}}}|{{{link|This chest}}}]] {{#if:{{{DC|}}}|with the [[Difficulty Class|DC {{{DC|}}}]] to lockpick|}} }} contains the following items:'''
<div class="mw-collapsible-content noexcerpt" style="{{#if:{{{nograd|}}} | background:transparent; | background:#232323; border-radius:10px; padding: 15px;}}">
<div class="mw-collapsible-content noexcerpt" style="{{#if:{{{nograd|}}} | background:transparent; | background:#232323; border-radius:10px; padding: 15px;}}">
{{{contents|Empty}}}</div>
{{{contents|Empty}}}</div>
</div></includeonly><noinclude>
</div></includeonly><noinclude>
Everything is optional. You don't have to set a DC. You don't even have to set an image or a link!
{{see also|Template:Trader}}
Display the contents of a chest, inventory, trader, etc. in a collapsible box.


Usage:
All the parameters are optional. You don't have to set a DC. You don't even have to set an image or a link!
 
<nowiki>{{Chest</nowiki>
<nowiki>|icon=Gilded Chest A Icon.png</nowiki>
<nowiki>|link=Gilded Chest</nowiki>
<nowiki>|DC=25</nowiki>
<nowiki>|contents=</nowiki>
<nowiki>* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}</nowiki>
<nowiki>* {{SmIconLink|Torch of Revocation Icon.png|Torch of Revocation}}</nowiki>
<nowiki>* {{SmIconLink|Gold Pile Single Icon.png|Gold}} 54pcs</nowiki>
<nowiki>* {{SmIconLink|Topaz Icon.png|Topaz}}</nowiki>
<nowiki>* {{SmIconLink|Arrow of Ilmater Icon.png|Arrow of Ilmater}}</nowiki>
<nowiki>* {{SmIconLink|Arrow of Slaying Icon.png|Arrow of Dragon Slaying}}</nowiki>
<nowiki>}}</nowiki>
 
Result: {{Chest|icon=Gilded Chest A Icon.png|link=Gilded Chest|DC=25
|contents=* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}
* {{SmIconLink|Torch of Revocation Icon.png|Torch of Revocation}}
* {{SmIconLink|Gold Pile Single Icon.png|Gold}} 54pcs
* {{SmIconLink|Topaz Icon.png|Topaz}}
* {{SmIconLink|Arrow of Ilmater Icon.png|Arrow of Ilmater}}
* {{SmIconLink|Arrow of Slaying Icon.png|Arrow of Dragon Slaying}}}}
 
Or even:
 
 
Usage:
 
<nowiki>{{Chest</nowiki>
<nowiki>|link=Gilded Chest</nowiki>
<nowiki>|contents=</nowiki>
<nowiki>* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}</nowiki>
<nowiki>* {{SmIconLink|Torch of Revocation Icon.png|Torch of Revocation}}</nowiki>
<nowiki>* {{SmIconLink|Gold Pile Single Icon.png|Gold}} 54pcs</nowiki>
<nowiki>* {{SmIconLink|Topaz Icon.png|Topaz}}</nowiki>
<nowiki>* {{SmIconLink|Arrow of Ilmater Icon.png|Arrow of Ilmater}}</nowiki>
<nowiki>* {{SmIconLink|Arrow of Slaying Icon.png|Arrow of Dragon Slaying}}</nowiki>
<nowiki>}}</nowiki>
 
Result: {{Chest|link=Gilded Chest|contents=* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}
* {{SmIconLink|Torch of Revocation Icon.png|Torch of Revocation}}
* {{SmIconLink|Gold Pile Single Icon.png|Gold}} 54pcs
* {{SmIconLink|Topaz Icon.png|Topaz}}
* {{SmIconLink|Arrow of Ilmater Icon.png|Arrow of Ilmater}}
* {{SmIconLink|Arrow of Slaying Icon.png|Arrow of Dragon Slaying}}}}
 
Usage:
<nowiki>{{Chest</nowiki>
<nowiki>|title_override=This shop shop</nowiki>
<nowiki>|contents=</nowiki>
<nowiki>* {{GoldIcon|592}} 592 [[Gold]]</nowiki>
<nowiki>}}</nowiki>
 
{{Chest|title_override=This shop|contents=* {{GoldIcon|592}} 592 [[Gold]]}}
 
And as always, {{InfoBlob|nograd}}=1 will remove the gradient.


== Examples ==
{{Template demo
| style = list
| <nowiki>
{{Chest
| icon = Jeweled Chest A Faded.webp
| link = Gilded Chest
| DC = 25
| contents =
* {{RarityItem|Acquisitions Record}}
* {{RarityItem|Torch of Revocation}}
* {{RarityItem|Gold}} 54pcs
* {{RarityItem|Topaz}}
* {{RarityItem|Arrow of Ilmater}}
* {{RarityItem|Arrow of Dragon Slaying}}
}}
</nowiki>
| <nowiki>
{{Chest
| link = Gilded Chest
| nograd = 1
| contents =
* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}
* {{RarityItem|Torch of Revocation}}
* {{RarityItem|Gold}} 54pcs
* {{RarityItem|Topaz}}
* {{RarityItem|Arrow of Ilmater}}
* {{RarityItem|Arrow of Dragon Slaying}}
}}
</nowiki>
| <nowiki>
{{Trader
| title_override = This shop
| contents =
* {{GoldIcon|592}} 592 [[Gold]]
}}
</nowiki>
}}
== Template data ==
<templatedata>
{
"params": {
"link": {
"label": "Link",
"description": "A link to the chest item.",
            "type": "wiki-page-name",
"required": false
},
        "DC": {
"label": "DC",
"description": "The difficulty class to pick the chest's lock, if applicable.",
            "type": "string",
"required": false
},
"title_override": {
"label": "Title override",
"description": "Ignore all the previous parameters used for title creation and use this instead.",
            "type": "string",
"required": false
},
        "icon": {
"label": "Icon",
"description": "An icon to display for the collapsible box.",
            "type": "wiki-file-name",
            "default": "Concentration Icon.png",
"required": false
},
        "nograd": {
"label": "No gradient",
"description": "Don't display the color gradient for the collapsible box.",
            "type": "boolean",
"required": false
}
    },
    "description": "Display the contents of a chest in a collapsible box.",
    "format": "block"
}
</templatedata>
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 06:11, 20 July 2024

See also: Template:Trader

Display the contents of a chest, inventory, trader, etc. in a collapsible box.

All the parameters are optional. You don't have to set a DC. You don't even have to set an image or a link!

Examples

Markup
{{Chest
| icon = Jeweled Chest A Faded.webp
| link = Gilded Chest
| DC = 25
| contents =
* {{RarityItem|Acquisitions Record}}
* {{RarityItem|Torch of Revocation}}
* {{RarityItem|Gold}} 54pcs
* {{RarityItem|Topaz}}
* {{RarityItem|Arrow of Ilmater}}
* {{RarityItem|Arrow of Dragon Slaying}}
}}
Renders as
Markup
{{Chest
| link = Gilded Chest
| nograd = 1
| contents =
* {{SmIconLink|Book Note M Image.png|Acquisitions Record}}
* {{RarityItem|Torch of Revocation}}
* {{RarityItem|Gold}} 54pcs
* {{RarityItem|Topaz}}
* {{RarityItem|Arrow of Ilmater}}
* {{RarityItem|Arrow of Dragon Slaying}}
}}
Renders as
Markup
{{Trader
| title_override = This shop
| contents =
* {{GoldIcon|592}} 592 [[Gold]]
}}
Renders as

Trade Icon.png This shop contains the following items:

Template data

Display the contents of a chest in a collapsible box.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Linklink

A link to the chest item.

Page nameoptional
DCDC

The difficulty class to pick the chest's lock, if applicable.

Stringoptional
Title overridetitle_override

Ignore all the previous parameters used for title creation and use this instead.

Stringoptional
Iconicon

An icon to display for the collapsible box.

Default
Concentration Icon.png
Fileoptional
No gradientnograd

Don't display the color gradient for the collapsible box.

Booleanoptional