Template:Counter: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Created page with "<includeonly>{{#vardefine:{{{counter name|counter}}}|{{#expr:{{#var:{{{counter name|counter}}}}}+1}}}}</includeonly><noinclude>{{Documentation |content=Template that adds +1 to the value of the local variable "counter" every time it is called. == Usage == Define the variable with {{code|<nowiki>{{#vardefine:counter|0}}</nowiki>}} before calling the template {{code|<nowiki>{{Counter}}</nowiki>}}. If you need multiple counters that count at the same time use the {{code|<...")
 
mNo edit summary
Line 27: Line 27:
   | format=template
   | format=template
   | template=counter/2
   | template=counter/2
}}
}}Total Rows: "{{#var:counter}}"
 
Total Rows: "{{#var:counter}}"
}}</noinclude>
}}</noinclude>

Revision as of 09:48, 5 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: "0"