Difference between revisions of "Template:Get-field"

From 7 Days to Die Wiki
Jump to: navigation, search
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{#vardefine:result|{{#if: {{{addit|}}}|{{#expr:{{#dpl:|debug=0|skipthispage=no |title={{{1}}} |include={{#ifeq:{{{3}}}| NPC | {Infobox npc}:{{{2}}} |{Infobox Item}:{{{2}}} }} }} + {{{addit|0}}} }} | {{#dpl:|debug=0|skipthispage=no |title={{{1}}} |include={{#ifeq:{{{3}}}| NPC | {Infobox npc}:{{{2}}} |{Infobox Item}:{{{2}}} }} }} }} }}{{#if:{{#var:result}} | {{#if:{{{ref|}}} |{{#ifeq:{{lc:{{{ref}}}}}|numeric| |{{Link/Start}}{{{1}}}{{!}} }} }}{{#var:result}} {{#if:{{{ref|}}}|{{#ifeq:{{lc:{{{ref}}}}}|numeric| ^|{{Link/End}} }} }} {{#if: {{{ref|}}} | {{#ifeq:{{lc:{{{ref}}}}}|silent| |<sup>([[{{{1}}}]])</sup>}} }}|{{{def|}}} }}<noinclude>
{{#vardefine:result|{{#if: {{{addit|}}}|{{#expr:{{#dpl:|debug=0|skipthispage=no |title={{{1}}} |include={{#ifeq:{{{3|}}}| Mod | {Infobox mod}:{{{2}}} |{Infobox Item}:{{{2}}} }} }} + {{{addit|0}}} }} | {{#dpl:|debug=0|skipthispage=no |title={{{1}}} |include={{#ifeq:{{{3|}}}| Mod | {Infobox mod}:{{{2}}} |{Infobox Item}:{{{2}}} }} }} }} }}{{#if:{{#var:result}} | {{#if:{{{ref|}}} |{{#ifeq:{{lc:{{{ref}}}}}|numeric| |{{Link/Start}}{{{1}}}{{!}} }} }}{{#var:result}} {{#if:{{{ref|}}}|{{#ifeq:{{lc:{{{ref}}}}}|numeric| ^|{{Link/End}} }} }} {{#if: {{{ref|}}} | {{#ifeq:{{lc:{{{ref}}}}}|silent| |<sup>([[{{{1}}}]])</sup>}} }}|{{{def|}}} }}<noinclude>

Latest revision as of 20:21, 9 May 2021

Template-info.png Documentation

This template is designed to return values that have been defined in other pages infoboxes. It is currently only set up for Infobox Items.

Parameters[edit source]

The parameters for this template are mostly positional.

Parameter Legal Values Description Auto-links
1st The name of the page that contains the field that is to be returned. Y
2nd The name of the field on that page that will be returned. Y
3rd If this exists, the template changes the infobox type. Currently only works for Infobox NPC when typed npc. N
ref If ref exists then the template will also return a link to the page.
If ref is equal to Silent the link will come from the value, but no extra reference will be displayed.
If ref is equal to numeric the link will come the text following, but not from the number itself, to enable operations on the value.
def If defined this value will be used as the return value if no value is found. Generally used to make expressions work without error. N
add If defined this value will be added to the base value found from the template. N