Template:ResourceIconHelper: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly><!-- Handle resources in the format of [count] <resource> e.g. "ki:4" or just "ki" -->{{#lvardef:type|{{ #explode: {{{1}}}|:|0}}}}<!-- Split parameter into type and count on the : -->{{resource|{{#lvar: type}}|icononly=yes}} </includeonly><noinclude> =What is this?= This is a wrapper around Template:Resource to work better in conjunction with Module:ParseList specifically by Template:ResourceIconList. Optional parameters like <code>cost=3</code>...")
 
(Fixed errant linebreak in ResourceIconList with multiple resources)
Line 3: Line 3:
-->{{#lvardef:type|{{ #explode: {{{1}}}|:|0}}}}<!--
-->{{#lvardef:type|{{ #explode: {{{1}}}|:|0}}}}<!--
Split parameter into type and count on the :
Split parameter into type and count on the :
-->{{resource|{{#lvar: type}}|icononly=yes}}
-->{{resource|{{#lvar: type}}|icononly=yes}}</includeonly><noinclude>
</includeonly><noinclude>
=What is this?=
=What is this?=
This is a wrapper around [[Template:Resource]] to work better in conjunction with [[Module:ParseList]] specifically by [[Template:ResourceIconList]].
This is a wrapper around [[Template:Resource]] to work better in conjunction with [[Module:ParseList]] specifically by [[Template:ResourceIconList]].

Revision as of 18:56, 25 November 2023

What is this?

This is a wrapper around Template:Resource to work better in conjunction with Module:ParseList specifically by Template:ResourceIconList.

Optional parameters like cost=3 do not work when applying a template to a list with ParseList, so this template enables an alternative syntax that can be used with ParseList.

Usage

{{ResourceIconHelper | <type>:[count]}}


<> Denotes mandatory parameters, [] denotes optional parameters.

Refer to Template:Resource for a list of the handled resource types.

Examples

Output Input
{{ResourceIconHelper|ki}}
{{ResourceIconHelper|ki:5}}
{{ResourceIconHelper|movement:30}}