Template:LocLine: Difference between revisions

Check if the quantity is a valid number (so "?" is not passed as a value), and use -1 instead of null so it shows up in lua
(Build up a JSON object to store as a singular smw property)
(Check if the quantity is a valid number (so "?" is not passed as a value), and use -1 instead of null so it shows up in lua)
Line 3:
<td>{{#show: {{{loc}}} |?Episode }}</td>
<td>{{#if:{{{quantity|}}}|{{{quantity}}}|{{Unknown}}}}</td>
</tr>{{#subobject:LOC_{{{loc}}}|Location object={{#if:{{#var:loc_version}}|{{FULLPAGENAME}}#{{#var:loc_version}}|{{FULLPAGENAME}}}}|Located in={{{loc}}}|Location quantity={{#if:{{{quantity|}}}|{{{quantity}}}|Unknown}}}}{{#vardefine:loc_json|{{#var:loc_json}}{{#if:{{#var:loc_json}}|,|{{(}}}}"{{{loc}}}":{{#ififerror:{{#expr:{{{quantity|-1}}}}}|-1|{{{quantity|-1}}}|null}}}}</includeonly><noinclude>{{/doc}}</noinclude>
698

edits