Predloga:Count

0

Dokumentacija za predlogo[poglej] [uredi] [zgodovina] [osveži]

Returns a number from (0 or 1) to 10 indicating the number of defined parameters passed.  Currently supports a maximum of 10 parameters.

UsageUredi

Set base=0 or base=1 to change from the default value returned if there are no defined parameters.  (i.e. If no defined parameters, returns 0 by default (or 1 if base=1))

ExamplesUredi

Note: {{ Count/testniprimeri1}} tests nesting of templates calling {{ Count}}.

Call Result
{{ Count| A| B| | D}} 3
{{ Count/testniprimeri1}} 0
{{ Count/testniprimeri1| base=1}} 1
{{ Count/testniprimeri1| base=0}} 0
{{ Count/testniprimeri1| abc}} 1
{{ Count/testniprimeri1| abc| base=0}} 1
{{ Count/testniprimeri1| abc| base=1}} 1
{{ Count/testniprimeri1| | DEF}} 1
{{ Count/testniprimeri1| abc| DEF}} 2
{{ Count/testniprimeri1| abc| DEF| }} 2
{{ Count/testniprimeri1| abc| DEF| ghi}} 3
{{ Count/testniprimeri1| abc| | ghi}} 2
{{ Count/testniprimeri1| abc| DEF| ghi| JKL| mno| PQR| stu| VWX| yz#}} 9
{{ Count/testniprimeri1| abc| DEF| ghi| JKL| mno| PQR| stu| VWX| yz@|  #$%}} 10
{{ Count/testniprimeri1| abc| DEF| ghi| JKL| mno| PQR| stu| VWX| yz@|  #$%| ^&*| ()_| +:"| 123| 456| 789| 000}} 10   Only counts to 10 right now!
{{ Count/testniprimeri1| abc| | ghi| | mno| | stu| | yz@| }} 5
{{ Count/testniprimeri1| | DEF| | JKL| | PQR| | VWX| |  #$%}} 5
{{ Count/testniprimeri1| DEF| JKL| PQR| VWX|  #$%}} 5
{{ Count/testniprimeri1| | | | | | | | | |  #$%}} 1
{{ Count/testniprimeri1| | | | | | | | | }} 0
{{ Count/testniprimeri1| | | | | | | | | | base=0}} 0
{{ Count/testniprimeri1| | | | | | | | | | base=1}} 1
{{ Count/testniprimeri1| base=0| | | | | | | | | }} 0
{{ Count/testniprimeri1| base=1| | | | | | | | | }} 1
{{ Count/testniprimeri1| base=0| | | | | | PQR| | | }} 1
{{ Count/testniprimeri1| base=1| | | | | | PQR| | | }} 1

See alsoUredi