Template:Harvested Materials Row: Difference between revisions

From Deez Nuts' Sword Coast Campaign
Jump to navigation Jump to search
Harvest DB: emit leading/trailing newlines — Cargo format=template concatenates rows without them, breaking row separation
Harvest DB: render standard effect tags under the effect prose in the ledger
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;}}}}
| {{#switch:{{{signature|}}}|Yes|1={{{component|}}} ''(signature)''|#default={{{component|}}}}} || {{{QTY|}}} || [[{{{creature|}}}]] || {{{rarity|}}} || {{{cv|}}} || {{#if:{{{effect|}}}|{{{effect}}}|&mdash; ''(structure only)''}}{{#if:{{{effects|}}}|<br /><small>{{{effects}}}</small>|}} || {{#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>
</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. The leading and trailing newlines are load-bearing: Cargo concatenates template-format rows without line breaks.
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; the standard effect tags render small under the prose. The leading and trailing newlines are load-bearing: Cargo concatenates template-format rows without line breaks.
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 02:36, 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; the standard effect tags render small under the prose. The leading and trailing newlines are load-bearing: Cargo concatenates template-format rows without line breaks.