Template:HeroInfoBox: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 3: Line 3:


This template is the intended means of summoning an infobox for Heroes on their individual pages.  Provide the internal ID of the hero associated with that page, provide the language, and the result will be filled in using data from [[Help:Cargo|Cargo]].   
This template is the intended means of summoning an infobox for Heroes on their individual pages.  Provide the internal ID of the hero associated with that page, provide the language, and the result will be filled in using data from [[Help:Cargo|Cargo]].   
The language will switch which template is being called.  "en" will call [[Template:HeroInfoBox/en]], "pl" will call [[Template:HeroInfoBox/pl]], etc.  This is to permit each individual language to tweak the terminology and/or presentation as needed for their particular wiki.
   
   


{{Template:HeroInfoBox|lang=en|id=demon_hero_4}}
{{HeroInfoBox|lang=en|id=demon_hero_4}}


<code><nowiki>{{Template:HeroInfoBox|lang=en|id=demon_hero_4}}</nowiki></code>
<code><nowiki>{{HeroInfoBox|lang=en|id=demon_hero_4}}</nowiki></code>
{{clear}}
{{clear}}
</noinclude><includeonly>
</noinclude><includeonly>{{#switch: {{#lc:{{{lang}}} }}
| pl = {{HeroInfoBox/pl}}
| {{HeroInfoBox/en|id={{{id}}} }}
}}
 




{{#cargo_query:tables=Hero=H,HeroClass=HC,Faction=F
|join on=H.class_id=HC.id,H.faction=F.id
|fields= H.id=id, H.name, H.motto, H.description=biography, H.name_sid, H.motto_sid, H.desc_sid, HC.name=class, F.name=faction, H.class_type, H.icon, H.specialization_id, H.source_path, H.start_skills=start_skills, H.start_skill_levels, H.start_magics, H.cost_gold, H.start_level, H.attacks_times_before, H.mesh, H.mount, H.native_biome, H.skills_roll_variant, H.view_radius, H.stats_num, H.magic_casts_per_round, H.enable_tactics, H.tactics_placement_size, H.enable_hero_native_biome,
IF(H.offence IS NULL, HC.offence, H.offence)=startattack,
IF(H.defence IS NULL, HC.defence, H.defence)=startdefense,
IF(H.spell_power IS NULL, HC.spell_power, H.spell_power)=startspellpower,
IF(H.intelligence IS NULL, HC.intelligence, H.intelligence)=startknowledge,
H.luck, H.morale, H.roll_lvl1_attack, H.roll_lvl1_defense, H.roll_lvl1_power, H.roll_lvl1_knowledge, H.roll_lvl24_attack, H.roll_lvl24_defense, H.roll_lvl24_power, H.roll_lvl24_knowledge
|where=H.id='{{{id}}}'
|format=template
|template=HeroInfoBox/en
|named args= yes
|delimiter=\n
}}
</includeonly>
</includeonly>

Revision as of 16:45, 14 May 2026


This template is the intended means of summoning an infobox for Heroes on their individual pages. Provide the internal ID of the hero associated with that page, provide the language, and the result will be filled in using data from Cargo.

The language will switch which template is being called. "en" will call Template:HeroInfoBox/en, "pl" will call Template:HeroInfoBox/pl, etc. This is to permit each individual language to tweak the terminology and/or presentation as needed for their particular wiki.


Error: No field named "name" found for the database table "Hero".



{{HeroInfoBox|lang=en|id=demon_hero_4}}