Difference between revisions of "StatListBody"

m (syntax)
m (syntax fix + prettier code)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
-->{{#vardefine:string<!-- define variable
+
-->{{#vardefine:string|{{unlink|{{{1}}}}}}}<!-- remove link from parameter
-->|{{#explode:{{{1}}}|(|0}}}}<!-- remove characters before open bracket
 
 
-->:{{stat<!-- create stat
 
-->:{{stat<!-- create stat
-->|{{unlink<!-- remove links from query
+
-->|{{#if:1<!-- trick to strip any whitespace from the string
-->|{{#if:{{#var:string}}|{{#var:string}}}}}}<!-- trick to strip any whitespace from the string
+
-->|{{#explode:{{#var:string}}|(|0}}}}<!-- get part of string before '('
-->|link={{{1}}}<!-- still link to the original page
+
-->|link={{#var:string}}<!-- link to original page
 
-->}}</includeonly><noinclude>{{{{PAGENAME}}/Documentation}}</noinclude>
 
-->}}</includeonly><noinclude>{{{{PAGENAME}}/Documentation}}</noinclude>

Revision as of 12:08, 15 August 2023

Description

Creates a body for a Stat list using the parameters provided in the original inline query.

Usage

{{#ask: [[Category:Primary Basket Stats]]
|format=template
|template=StatListBody
}}