Template:Infobox hero: Difference between revisions

Jump to navigation Jump to search
Add support for races. Add pages automatically to their correct categories
(Initial commit of new hero template)
 
(Add support for races. Add pages automatically to their correct categories)
Line 13: Line 13:
}}{{
}}{{
   #vardefine: hero_image | {{#if: {{{image|}}} | {{{image}}} | Hero - {{{name|}}}.png }}
   #vardefine: hero_image | {{#if: {{{image|}}} | {{{image}}} | Hero - {{{name|}}}.png }}
}}{{
  #vardefine: race | {{ValidateRace|{{{race|}}}}}
}}<div class="herobox_border">
}}<div class="herobox_border">
<div class="herobox_content" style="background-color:{{#var: backgroundcolor}}>
<div class="herobox_content" style="background-color:{{#var: backgroundcolor}}>
Line 39: Line 41:
{{#if:{{#var: expansion}}|
{{#if:{{#var: expansion}}|
<div style="flex-grow: 1; flex-basis:50%; min-width:100px; margin-top:10px; margin-left:5px; margin-right:5px; text-align:center; margin:auto;">{{#var: expansionlogo}}<br>[[{{#var: expansion}}|{{#var: expansioncode}} {{#var: expansion}}]]</div>
<div style="flex-grow: 1; flex-basis:50%; min-width:100px; margin-top:10px; margin-left:5px; margin-right:5px; text-align:center; margin:auto;">{{#var: expansionlogo}}<br>[[{{#var: expansion}}|{{#var: expansioncode}} {{#var: expansion}}]]</div>
|}}
</div>
<div style="display:flex; flex-wrap:wrap;>
{{#if:{{#var: race}}|
<div style="flex-grow: 1; flex-basis:50%; min-width:100px; margin-top:10px; margin-left:5px; margin-right:5px; text-align:center; margin:auto;">Race:&nbsp;[[:Category:{{#var: race}}s|{{#var: race}}]]</div>
|}}
|}}
</div>
</div>
Line 55: Line 62:
</div>
</div>
</div>
</div>
</div></includeonly><noinclude>{{Infobox hero |name=Example Hero |expansion=DJ07 |archetype=Mage |image=Hero_-_Zyla.png |speed=5 |health=8 |stamina=5 |defense=Grey |willpower=3 |might=3 |knowledge=3 |awareness=3 |ability=I can do something... |feat=I'm not useless |quote=Catch me if you can}}{{documentation}}</noinclude>
</div>{{#if:{{#var: archetype}}|[[Category:{{#var: archetype}}s]]
|}}{{#if:{{#var: expansion}}|[[Category:{{#var: expansion}}]]
|}}{{#if:{{#var: race}}|[[Category:{{#var: race}}s]]
|}}</includeonly><noinclude>{{Infobox hero |name=Example Hero |expansion=DJ07 |archetype=Mage |race=fae |image=Hero_-_Zyla.png |speed=5 |health=8 |stamina=5 |defense=Grey |willpower=3 |might=3 |knowledge=3 |awareness=3 |ability=I can do something... |feat=I'm not useless |quote=Catch me if you can}}{{documentation}}</noinclude>

Navigation menu