Template:Harvested Materials Row: Difference between revisions

From Deez Nuts' Sword Coast Campaign
Jump to navigation Jump to search
Harvest DB: add display row template for the Harvested Materials ledger query
 
Harvest DB: link each effect tag to a prefilled, auto-run Find Components search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>|-
<includeonly>
| {{#switch:{{{signature|}}}|Yes|1={{{component|}}} ''(signature)''|#default={{{component|}}}}} || {{{QTY|}}} || [[{{{creature|}}}]] || {{{rarity|}}} || {{{cv|}}} || {{#if:{{{effect|}}}|{{{effect}}}|&mdash; ''(structure only)''}} || {{#if:{{#pos:{{{primary_for|}}}|Potion}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Potion}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Poison}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Poison}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Bomb}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Bomb}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Wand}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Wand}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Staff}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Staff}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Wondrous}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Wondrous}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Armor}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Armor}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Weapon}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Weapon}}|Contributor|&mdash;}}}}</includeonly><noinclude>
|-
Display row for the [[Harvested Materials]] component-inventory query (<code>format=template</code>, <code>named args=yes</code>). Expects the named args <code>component, QTY, creature, rarity, cv, effect, signature, primary_for, contributor_to</code> from a join of '''HarvestLog''' (summed quantities) and '''HarvestComponents''' (definitions). The eight item-type columns derive from the <code>primary_for</code> / <code>contributor_to</code> lists.
| {{#switch:{{{signature|}}}|Yes|1={{{component|}}} ''(signature)''|#default={{{component|}}}}} || {{{QTY|}}} || [[{{{creature|}}}]] || {{{rarity|}}} || {{{cv|}}} || {{#if:{{{effect|}}}|{{{effect}}}|&mdash; ''(structure only)''}}{{#if:{{{effects|}}}|<br /><span class="plainlinks"><small>{{#arraymap:{{{effects|}}}|,|@@@@|[{{fullurl:Find Components|pfRunQueryFormName=Component+Search&wpRunQuery=true&Component_Search%5Beffects%5D={{urlencode:@@@@|QUERY}}}} @@@@]|&#32;•&#32;}}</small></span>|}} || {{#if:{{#pos:{{{primary_for|}}}|Potion}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Potion}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Poison}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Poison}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Bomb}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Bomb}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Wand}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Wand}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Staff}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Staff}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Wondrous}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Wondrous}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Armor}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Armor}}|Contributor|&mdash;}}}} || {{#if:{{#pos:{{{primary_for|}}}|Weapon}}|'''Primary'''|{{#if:{{#pos:{{{contributor_to|}}}|Weapon}}|Contributor|&mdash;}}}}
</includeonly><noinclude>
Display row for the [[Harvested Materials]] component-inventory query (<code>format=template</code>, <code>named args=yes</code>). Expects the named args <code>component, QTY, creature, rarity, cv, effect, effects, signature, primary_for, contributor_to</code> from a join of '''HarvestLog''' (summed quantities) and '''HarvestComponents''' (definitions). The eight item-type columns derive from the <code>primary_for</code> / <code>contributor_to</code> lists. Each standard effect tag links to [[Find Components]] with that tag preselected and the search already run (PageForms RunQuery submits via GET, so a search is just a URL). The leading and trailing newlines are load-bearing: Cargo concatenates template-format rows without line breaks.
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 03:02, 13 September 2026

Display row for the Harvested Materials component-inventory query (format=template, named args=yes). Expects the named args component, QTY, creature, rarity, cv, effect, effects, signature, primary_for, contributor_to from a join of HarvestLog (summed quantities) and HarvestComponents (definitions). The eight item-type columns derive from the primary_for / contributor_to lists. Each standard effect tag links to Find Components with that tag preselected and the search already run (PageForms RunQuery submits via GET, so a search is just a URL). The leading and trailing newlines are load-bearing: Cargo concatenates template-format rows without line breaks.