Difference between revisions of "Template:Player anecdotes"

From QBWiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
<includeonly>==Anecdotes==
 
<includeonly>==Anecdotes==
{{#ifexist:{{FULLPAGENAME}}/anecdotes
 
|{{#vardefine:ii|{{#time:z}}}}
 
{{#vardefine:size|{{Size|Anecdote}}}}
 
 
:''Full list: [[{{FULLPAGENAME}}/anecdotes]]''
 
:''Full list: [[{{FULLPAGENAME}}/anecdotes]]''
* {{Smart lookup|Anecdote|{{#var:ii}}}}
+
{{List lookup helper|{{FULLPAGENAME}}/anecdotes}}<!--
{{#ifexpr:{{#var:size}}>1|{{#vardefine:jj|{{#expr:2*{{#time:z}}}}}}{{#ifexpr:({{#var:jj}} mod {{#var:size}})={{#var:ii}}|{{Add|jj|1}}}}
+
-->{{#ifexpr:{{#var:length}}=1|<nowiki/>
* {{Smart lookup|Anecdote|{{#var:jj}}}}
+
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|1}}}}<!--
}}
+
-->{{#ifexpr:{{#var:length}}=2|<nowiki/>
{{#ifexpr:{{#var:size}}>2|{{#vardefine:kk|{{#expr:3*{{#time:z}}}}}}{{#ifexpr:({{#var:kk}} mod {{#var:size}})={{#var:ii}}|{{Add|kk|1}}}}{{#ifexpr:({{#var:kk}} mod {{#var:size}})={{#var:jj}}|{{Add|kk|1}}}}
+
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|1}}
* {{Smart lookup|Anecdote|{{#var:kk}}}}
+
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|2}}}}<!--
}}
+
-->{{#ifexpr:{{#var:length}}>2|<nowiki/>
|''There are no anecdotes for this player - add some at [[{{FULLPAGENAME}}/anecdotes]]''
+
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|{{PRNG|{{#time:z}}}}}}
}}</includeonly><noinclude>{{Template doc|
+
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|{{PRNG|{{#expr:{{#time:z}}+1}}}}}}
 +
* {{Smart lookup|{{FULLPAGENAME}}/anecdotes|{{PRNG|{{#expr:{{#time:z}}+2}}}}}}}}</includeonly><noinclude>{{Template doc|
 
Adds a section with consistent formatting listing 3 unique anecdotes from a list at <nowiki>{{CURRENTPAGE}}/anecdotes</nowiki>.
 
Adds a section with consistent formatting listing 3 unique anecdotes from a list at <nowiki>{{CURRENTPAGE}}/anecdotes</nowiki>.
 
Current behavior is to fetch the list and then pick the ''n'', ''2n'', and ''3n''-th entries, where ''n'' is the current day index. If there are fewer than three, it will omit those bullet points.
 
Current behavior is to fetch the list and then pick the ''n'', ''2n'', and ''3n''-th entries, where ''n'' is the current day index. If there are fewer than three, it will omit those bullet points.
 
  
 
<pre>{{Player anecdotes}}</pre>
 
<pre>{{Player anecdotes}}</pre>

Revision as of 21:01, 14 December 2025

Template documentation

Adds a section with consistent formatting listing 3 unique anecdotes from a list at {{CURRENTPAGE}}/anecdotes. Current behavior is to fetch the list and then pick the n, 2n, and 3n-th entries, where n is the current day index. If there are fewer than three, it will omit those bullet points.

{{Player anecdotes}}

Anecdotes

Full list: Template:Player anecdotes/anecdotes

  • test16
  • test19
  • test22

References