Template:Expose Item: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(more deets)
(add level information into template, update docs)
Line 1: Line 1:
<onlyinclude><includeonly>{{#vardefine:page_exposed_items|{{#var:page_exposed_items}},{{{1}}} }}</includeonly></onlyinclude>
<onlyinclude><includeonly>{{#vardefine:page_exposed_items|{{#var:page_exposed_items}},{{{1}}}++{{#var:page_expose_item_level_low}}++{{#var:page_expose_item_level_high}} }}</includeonly></onlyinclude>


Warning: at the moment this is an experimental template and it may be changed without warning or backwards compatibility. Please don't use it without a good reason to.
Warning: at the moment this is an experimental template and it may be changed without warning or backwards compatibility. Please don't use it without a good reason to.
Line 11: Line 11:


Items are stored in following format separated by commas: <pre>
Items are stored in following format separated by commas: <pre>
ITEM_NAME+LEVEL_LOW+LEVEL_HIGH
ITEM_NAME++LEVEL_LOW++LEVEL_HIGH
</pre>
</pre>


The level low and high are read from vars <tt>page_expose_item_level_low</tt> and <tt>page_expose_item_level_high</tt>, defaulting to 1 and 12, respectively. Vars are set with [[Template:Expose Item/SetLevel]], read with [[Template:Expose Item/ReadLevel]], and reset with [[Template:Expose Item/ResetLevel]]. '''ResetLevel''' should be called by '''DropTableEnd''', while '''SetLevel''' should be called by [[Template:DropTableLevel]]. [[Template:DropTableDivider]] will be the implementation details of '''DropTableLevel'''.
The level low and high are read from vars <tt>page_expose_item_level_low</tt> and <tt>page_expose_item_level_high</tt>, defaulting to 1 and 12, respectively. Vars are set with [[Template:Expose Item/SetLevel]] and reset with [[Template:Expose Item/ResetLevel]]. '''ResetLevel''' should be called by '''DropTableStart''', while '''SetLevel''' should be called by [[Template:DropTableLevel]]. [[Template:DropTableDivider]] will be the implementation details of '''DropTableLevel'''.

Revision as of 09:44, 14 September 2023


Warning: at the moment this is an experimental template and it may be changed without warning or backwards compatibility. Please don't use it without a good reason to.

What this templates does: it appends the provided single item name to the contents of the non-locally scoped var page_exposed_items.

Why: This will make it possible to collect a list of every drop table item transcluded into a page, thus letting you later query sources of items.

{{Expose Item|<item name to expose>}}
Items are stored in following format separated by commas:
ITEM_NAME++LEVEL_LOW++LEVEL_HIGH

The level low and high are read from vars page_expose_item_level_low and page_expose_item_level_high, defaulting to 1 and 12, respectively. Vars are set with Template:Expose Item/SetLevel and reset with Template:Expose Item/ResetLevel. ResetLevel should be called by DropTableStart, while SetLevel should be called by Template:DropTableLevel. Template:DropTableDivider will be the implementation details of DropTableLevel.