PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Template:Stat/doc: Difference between revisions

From PC Gaming Shelter
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
local itemName = args[1] or 'Shelter'
local itemValue = args[2] or '100%'
local itemTarget = args['target'] or nil
local itemClass = args['class'] or ''
local itemImage = args['image'] or 'Shelter.png'
{{Stat}}
<templatedata>
<templatedata>
{
{
Line 11: Line 4:
"1": {
"1": {
"label": "Measurement",
"label": "Measurement",
"type": "string"
"type": "string",
"default": "Shelter"
},
},
"2": {
"2": {
"label": "Value",
"label": "Value",
"type": "string"
"type": "string",
"default": "100%"
},
},
"target": {
"target": {
Line 25: Line 20:
"label": "Image",
"label": "Image",
"description": "Name of the image for the icon.",
"description": "Name of the image for the icon.",
"type": "string",
"default": "Shelter.png"
},
"class": {
"label": "CSS class",
"description": "A valid CSS class name to add to the row.",
"type": "string"
"type": "string"
}
}
Line 31: Line 32:
}
}
</templatedata>
</templatedata>
== Example ==
<pre>
{{stat|Guardians:|14|image=Icon-Guardians.png}}
</pre>
;Result
{{stat|Guardians:|14|image=Icon-Guardians.png}}
The widget is designed for manual updating: [[MediaWiki:Shelter-statistics]].

Latest revision as of 11:23, 26 March 2026

A helper template that generates a row for the Statistics widget on the main page.

Template parameters

ParameterDescriptionTypeStatus
Measurement1

no description

Default
Shelter
Stringoptional
Value2

no description

Default
100%
Stringoptional
Target pagetarget

Name of a linked page.

Page nameoptional
Imageimage

Name of the image for the icon.

Default
Shelter.png
Stringoptional
CSS classclass

A valid CSS class name to add to the row.

Stringoptional

Example

{{stat|Guardians:|14|image=Icon-Guardians.png}}
Result
Guardians:
14

The widget is designed for manual updating: MediaWiki:Shelter-statistics.