Template:Counter: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
mNo edit summary
m (Updated counter/2)
 
Line 20: Line 20:
Total Rows: "{{#var:counter}}"
Total Rows: "{{#var:counter}}"
</pre>
</pre>
{{#vardefine:counter|0}}
{{#vardefine:counter2|0}}
{{#cargo_query:
{{#cargo_query:
   tables=conditions
   tables=conditions
Line 27: Line 27:
   | format=template
   | format=template
   | template=counter/2
   | template=counter/2
}}Total Rows: "{{#var:counter}}"
}}Total Rows: "{{#var:counter2}}"
}}</noinclude>
}}</noinclude>

Latest revision as of 09:50, 6 February 2024

Template documentation

Template that adds +1 to the value of the local variable "counter" every time it is called.

Usage

Define the variable with {{#vardefine:counter|0}} before calling the template {{Counter}}.

If you need multiple counters that count at the same time use the {{counter/2}} template and define with {{#vardefine:counter2|0}}

Examples

{{#vardefine:counter|0}}
{{#cargo_query:
  tables=conditions
  | fields=name
  | where=stack_id='HASTE'
  | format=template
  | template=counter
}}

Total Rows: "{{#var:counter}}"

Total Rows: "4"