Difference between revisions of "Template:Legio Header"

From Australis Ultima 30k
Jump to: navigation, search
m (Example Working)
m (Example Working)
Line 42: Line 42:
 
}}
 
}}
 
{{#iferror: {{#expr: {{#var:cyclecnt}} + 1 }} |{{#vardefine:cyclecnt|0}}|}}
 
{{#iferror: {{#expr: {{#var:cyclecnt}} + 1 }} |{{#vardefine:cyclecnt|0}}|}}
 +
 +
 
{{#ifexpr: {{#var:cyclecnt}} < 10  
 
{{#ifexpr: {{#var:cyclecnt}} < 10  
 
| {{#dpl:
 
| {{#dpl:
Line 68: Line 70:
 
</div>
 
</div>
  
{{#switch: 5
+
{{#switch:  
  | 0 = no dpl
+
  | 0 ={{ #vardefine: icc |{{#var:cyclecnt}}}}{{
  | 1|2|3|4|5 = dpl + extra
+
  #while:
  | default result
+
  | {{ #ifexpr: {{ #var: icc }} < 10 | true }}
 +
  |<div style="display:inline;">[[File:Legio Nil.png|bottom|link=|frameless|{{#var:msize}}|Empty]]</div>
 +
{{ #vardefine: icc | {{ #expr: {{ #var: icc }} + 1 }} }}
 +
}}
 +
  |1|2|3|4|5|6|7|8|9 = {{#dpl:
 +
|category =Player
 +
|category =Legio II
 +
|notnamespace=Template
 +
|include= {Infobox Army}:image
 +
|escapelinks=true
 +
|format=,<div style="display:inline;">[[,|{{#var:msize}}|bottom|link=%PAGE%]]</div>
 +
}}
 +
{{ #vardefine: icc |{{#var:cyclecnt}}}}{{
 +
  #while:
 +
  | {{ #ifexpr: {{ #var: icc }} < 10 | true }}
 +
  |<div style="display:inline;">[[File:Legio Nil.png|bottom|link=|frameless|{{#var:msize}}|Empty]]</div>
 +
{{ #vardefine: icc | {{ #expr: {{ #var: icc }} + 1 }} }}
 +
}}
 +
  |{{#dpl:
 +
|category =Player
 +
|category =Legio I
 +
|notnamespace=Template
 +
|include= {Infobox Army}:image
 +
|escapelinks=true
 +
|format=,<div style="display:inline;">[[,|{{#var:msize}}|bottom|link=%PAGE%]]</div>
 +
}}
 
}}
 
}}
  

Revision as of 16:54, 31 August 2014

Expression error: Unexpected < operator.

Example Working


Extension:DynamicPageList (DPL), version 2.3.0 : Warning: No results.

Empty
Empty
Empty
Empty
Empty
Empty
Empty
Empty
Empty
Empty
Blanche DA.jpg
Legio I.png
Legio Nil.png
Legio Nil.png
Legio Nil.png
DA Legionary Primaris 2.jpg
Legio Nil.png
Legio I.png
Legio Nil.png
Hh da by warbringervi-dalm316.jpg
VolkTroop.png
Legio Nil.png
Legio I.png
Legio I.png
Legio Nil.png

Explanation

  • The first DPL extract returns a count of the number of pages that are going to be returned in the Query and sets the variable "cyclecnt" to this number.
  • The second block starts of by checking the value of "cyclecnt" if this is less than 10 then it runs through an alternate output which pushes a number of greyed out or place holder marine graphics along the top of the page such that the minimum number of marine icons across the top of the page is 10, mostly for aesthetic reasons.
  • If a Legio already has 10 armies present then simply the number of army graphics is displayed whether this is 10 or more.