Difference between revisions of "Template:Featured picture index"

From QBWiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
<includeonly>{{#vardefine:index|{{{1|1}}}}}{{#if:{{QBWiki:Featured picture/{{#var:index}}}}
+
<includeonly>{{#vardefine:index|{{{1|1}}}}}{{#ifexist:{{QBWiki:Featured picture/{{#var:index}}}}
 
|{{QBWiki:Featured picture/{{#var:index}}}}
 
|{{QBWiki:Featured picture/{{#var:index}}}}
 
|{{#vardefine:minindex|{{#var:index}}}}{{#vardefine:maxindex|1}}<!--
 
|{{#vardefine:minindex|{{#var:index}}}}{{#vardefine:maxindex|1}}<!--
Line 5: Line 5:
 
-->{{#dowhile:
 
-->{{#dowhile:
 
|{{#ifexpr:{{#var:maxindex}}+1<{{#var:minindex}}|continue}}
 
|{{#ifexpr:{{#var:maxindex}}+1<{{#var:minindex}}|continue}}
|{{#if:{{QBWiki:Featured picture/{{#var:index}}}}
+
|{{#ifexist:{{QBWiki:Featured picture/{{#var:index}}}}
 
<!--undershoot-->|{{#ifexpr:{{#var:index}}>{{#var:maxindex}}|{{#vardefine:maxindex|{{#var:index}}}}}}
 
<!--undershoot-->|{{#ifexpr:{{#var:index}}>{{#var:maxindex}}|{{#vardefine:maxindex|{{#var:index}}}}}}
 
<!-- overshoot-->|{{#ifexpr:{{#var:index}}<{{#var:minindex}}|{{#vardefine:minindex|{{#var:index}}}}}}
 
<!-- overshoot-->|{{#ifexpr:{{#var:index}}<{{#var:minindex}}|{{#vardefine:minindex|{{#var:index}}}}}}
Line 13: Line 13:
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
 
Retrieve specific featured pictures from the list of featured pictures to be used in [[QBWiki:Featured picture]].
 
Retrieve specific featured pictures from the list of featured pictures to be used in [[QBWiki:Featured picture]].
 +
 +
When index i <= # of lingo quips, return quip straight away. If i > #, it'll wrap around (mod #).
  
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 18:44, 10 June 2022

Retrieve specific featured pictures from the list of featured pictures to be used in QBWiki:Featured picture.

When index i <= # of lingo quips, return quip straight away. If i > #, it'll wrap around (mod #).

Index Featured picture
1

Solon.jpg

The Solon High School quizbowl team competes at the 2018 PACE National Scholastic Championship.

Photo credit: David Reinstein

2

Solon.jpg

The Solon High School quizbowl team competes at the 2018 PACE National Scholastic Championship.

Photo credit: David Reinstein

3

Solon.jpg

The Solon High School quizbowl team competes at the 2018 PACE National Scholastic Championship.

Photo credit: David Reinstein

etc.