Difference between revisions of "Template:Infobox Army"
m |
m |
||
Line 110: | Line 110: | ||
{{#arrayunique:enemy}} | {{#arrayunique:enemy}} | ||
{{#arrayprint:enemy}} | {{#arrayprint:enemy}} | ||
− | |||
<!---------------------------------> | <!---------------------------------> | ||
<!---------------------------------> | <!---------------------------------> | ||
Line 149: | Line 148: | ||
<!-- string format at this point is enemyname@theylost@theywon --> | <!-- string format at this point is enemyname@theylost@theywon --> | ||
{{#var:allstatstring}} | {{#var:allstatstring}} | ||
+ | <!---------------------------------> | ||
+ | <!---------------------------------> | ||
+ | <!---------- Final Output ---------> | ||
+ | <!---------------------------------> | ||
+ | <!---------------------------------> | ||
+ | {{#arraydefine:allstatarray|{{#var:allstatstring}}|$}} | ||
+ | {{#arrayprint:allstatarray}} | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !colspan="4" scope="col"| {{#var:armyname}} fought | ||
+ | |- | ||
+ | |- | ||
+ | ! scope="col"| Combatants | ||
+ | ! scope="col"| Won | ||
+ | ! scope="col"| Lost | ||
+ | ! scope="col"| Draw | ||
+ | |- | ||
+ | {{ #vardefine: fi | 0 }} | ||
+ | {{ | ||
+ | #while: | ||
+ | | {{ #ifexpr: {{ #var: fi }} < {{#expr:{{#arraysize:allstatarray}}-1}} | true }} | ||
+ | |{{!-}} | ||
+ | {{!}}{{#explode:{{#arrayindex:allstatarray|{{#var:fi}}}}|@|0}} | ||
+ | {{!}}{{#explode:{{#arrayindex:allstatarray|{{#var:fi}}}}|@|1}} | ||
+ | {{!}}{{#explode:{{#arrayindex:allstatarray|{{#var:fi}}}}|@|2}} | ||
+ | {{!}}{{#explode:{{#arrayindex:allstatarray|{{#var:fi}}}}|@|3}} | ||
+ | {{!-}} | ||
+ | {{ #vardefine: fi | {{ #expr: {{ #var: fi }} + 1 }} }} | ||
+ | }} | ||
+ | |} | ||
}} | }} | ||
|- | |- |
Revision as of 20:39, 29 August 2014
No Title | |
---|---|
Legio: |
No information |
Designation: |
No information |
Cognomen: |
No information |
Allegiance: |
No information |
Campaigns: |
No information |
Battles: |
No information |
Skirmishes: |
No information |
| |
Contents
Description
An infobox with much easier and nice method for anyone to use. This Infobox classic is a kind of infobox where you can give titles to every row. Below are some of the rules to use this infobox.
Syntax
{{Infobox classic |Box title = |image = Image:Example.jpg |imagewidth = [defaults to 250] |imagelink = |caption = Wikipedia |Row 1 title = |Row 1 info = |Row 2 title = |Row 2 info = |Row 3 title = |Row 3 info = |Row 4 title = |Row 4 info = |Row 5 title = |Row 5 info = |Row 6 title = |Row 6 info = |Row 7 title = |Row 7 info = |Row 8 title = |Row 8 info = |Row 9 title = |Row 9 info = |Row 10 title = |Row 10 info = }}
Notes
- Keeping the Box Title empty will result in displaying No title
- If you don't want to display image, just keep Image file Name and Image Size empty.
- Leaving imagelink blank results in a no click image - decoration only
- Keeping the Row 1 title empty will result in displaying No title.
- Keeping the Row (any row) info empty will result in displaying No information.
- Keeping the Row (any below row 1) title empty will result in that row and the rest of the rows below it will not be displayed.
- Max row for information: 10 rows.
Sample output
Complete Infobox:
{{Infobox classic
|Box title = Info Title
|image = Image:Barren One.png
|imagewidth = 120
|imagelink = Barren Two
|caption = Barren One Links to Barren Two
|Row 1 title = Title row 1
|Row 1 info = Info row 1
|Row 2 title = Title row 2
|Row 2 info = Info row 2
|Row 3 title = Title row 3
|Row 3 info = Info row 3
|Row 4 title = Title row 4
|Row 4 info = Info row 4
|Row 5 title = Title row 5
|Row 5 info = Info row 5
|Row 6 title = Title row 6
|Row 6 info = Info row 6
|Row 7 title = Title row 7
|Row 7 info = Info row 7
|Row 8 title = Title row 8
|Row 8 info = Info row 8
|Row 9 title = Title row 9
|Row 9 info = Info row 9
|Row 10 title = Title row 10
|Row 10 info = Info row 10
}}
Info Title | |
---|---|
Title row 1 |
Info row 1 |
Title row 2 |
Info row 2 |
Title row 3 |
Info row 3 |
Title row 4 |
Info row 4 |
Title row 5 |
Info row 5 |
Title row 6 |
Info row 6 |
Title row 7 |
Info row 7 |
Title row 8 |
Info row 8 |
Title row 9 |
Info row 9 |
Title row 10 |
Info row 10 |
Infobox Image omitted :
{{Infobox classic
|Box title = Info Title
|Row 1 title = Title row 1
|Row 1 info = Info row 1
|Row 2 title = Title row 2
|Row 2 info = Info row 2
|Row 3 title = Title row 3
|Row 3 info = Info row 3
|Row 4 title = Title row 4
|Row 4 info = Info row 4
|Row 5 title = Title row 5
|Row 5 info = Info row 5
|Row 6 title = Title row 6
|Row 6 info = Info row 6
|Row 7 title = Title row 7
|Row 7 info = Info row 7
|Row 8 title = Title row 8
|Row 8 info = Info row 8
|Row 9 title = Title row 9
|Row 9 info = Info row 9
|Row 10 title = Title row 10
|Row 10 info = Info row 10
}}
Info Title | |
---|---|
Title row 1 |
Info row 1 |
Title row 2 |
Info row 2 |
Title row 3 |
Info row 3 |
Infobox Image omitted and displaying only 3 rows of information:
{{Infobox classic
|Box title = Info Title
|Row 1 title = Title row 1
|Row 1 info = Info row 1
|Row 2 title = Title row 2
|Row 2 info = Info row 2
|Row 3 title = Title row 3
|Row 3 info = Info row 3
}}
Info Title | |
---|---|
Title row 1 |
Info row 1 |
Title row 2 |
Info row 2 |
Title row 3 |
Info row 3 |
Infobox Image and title row 4 omited:
Result: Row 4, 5, and 6 will not be displayed.
{{Infobox classic
|Box title = Info Title
|Row 1 title = Title row 1
|Row 1 info = Info row 1
|Row 2 title = Title row 2
|Row 2 info = Info row 2
|Row 3 title = Title row 3
|Row 3 info = Info row 3
|Row 4 info = Info row 4
|Row 5 title = Title row 5
|Row 5 info = Info row 5
|Row 6 title = Title row 6
|Row 6 info = Info row 6
}}