Template:property statistics: Difference between revisions
From Thesaurus Inscriptionum Raeticarum
Jump to navigationJump to search
Martin Braun (talk | contribs) No edit summary |
Martin Braun (talk | contribs) No edit summary |
||
Line 24: | Line 24: | ||
|<nowiki/>{{#vardefine: i | {{ #expr: {{ #var: i }} + {{#var: step }} }} }}{{#vardefine: values | {{#var: values }}, {{ #var: i }} }} }} }}{{#vardefine: values | {{#replace: {{#var: values }}|, |,}} }}{{#vardefine: all | {{#ask:[[Category:{{#var: category }}]][[{{#var: property }}::+]]|format=count}} }} | |<nowiki/>{{#vardefine: i | {{ #expr: {{ #var: i }} + {{#var: step }} }} }}{{#vardefine: values | {{#var: values }}, {{ #var: i }} }} }} }}{{#vardefine: values | {{#replace: {{#var: values }}|, |,}} }}{{#vardefine: all | {{#ask:[[Category:{{#var: category }}]][[{{#var: property }}::+]]|format=count}} }} | ||
{{#ifeq: {{#var: all}}|0|none|Number of pages in the [[:Category:{{#var: category }}]] ({{#var: all}}) per "{{#var: property }}": | {{#ifeq: {{#var: all}}|0|none|Number of pages in the [[:Category:{{#var: category }}]] ({{#var: all}}) per "{{#var: property }}": | ||
{ | {{{!}} class="table_lines" width={{var|image_width}} | ||
! width="*" | ! width="*" {{!}} {{#var: property }} | ||
! occurrence | ! occurrence | ||
! colspan="3" | ! colspan="3" {{!}} | ||
{{!}}- {{#vardefine: i | 0 }}{{#vardefine: ok | 1 }}{{ #while: | |||
| {{ #ifexpr: {{ #var: ok }} = 1 | true }} | | {{ #ifexpr: {{ #var: ok }} = 1 | true }} | ||
|<nowiki/> | |<nowiki/> |
Revision as of 02:23, 18 June 2013
This template serves to display simple statistics on property pages with pre-defined values.
Usage
- This template can only be used on property pages
- with restricted allowed values or
- with the Type:Number
- The first parameter defines the category of the pages to be displayed in the statistics, i.e.
{{property statistics|Category}}
- Additional parameters can be used to display numbers:
- (2) start: mandatory for numbers
- (3) stop: if the stop value is omitted, 10 times the step value is used per default
- (4) step: if the step value is omitted, 1 is used per default
- (5) "range" (optional)
Examples
- The code
{{property statistics|Inscription}}
on the page Property:language will display the occurrence of pages in the Category:Inscription per each pre-defined language (i.e. Raetic, Etruscan, Venetic, Lepontic, Cisalpine Gaulish, Celtic, Latin, English, French, German, Italian, unknown, none, Camunic, Spanish, Slovenian). - The code
{{property statistics|Inscription|0|360|15}}
on the page Property:orientation will display the occurrence of pages in the Category:Inscription of every 15 degrees from 0 to 360 (i.e. 0, 15, 30, 45, ..., 360), while{{property statistics|Inscription|3}}
will do the same for every integer from 3 to 13. - The code
{{property statistics|Object|-650|50|100|range}}
on the page Property:sortdate will display the occurrence of pages in the Category:Object grouped in 100 years from 650 BC to 50 AD (i.e. -650 to -550, -550 to -450, ..., -50 to 50).