Template:HeroInfoBox: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary |
Revamped scalar cargo query call |
||
| Line 11: | Line 11: | ||
<code><nowiki>{{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>{{#cargo_query: | ||
tables = Hero=H, HeroClass=HC, Faction=F, | |||
Translation=hero_t, Translation=motto_t, Translation=class_t, Translation=faction_t | |||
|join on = H.class_id = HC.id, | |||
H.faction = F.id, | |||
H.id = hero_t.target_id, | |||
H.id = motto_t.target_id, | |||
</includeonly> | HC.id = class_t.target_id, | ||
F.id = faction_t.target_id | |||
|where = H.id = '{{{id|}}}' | |||
AND hero_t.type = 'hero' AND hero_t.language = '{{{lang|en}}}' | |||
AND motto_t.type = 'hero_motto' AND motto_t.language = '{{{lang|en}}}' | |||
AND class_t.type = 'hero_class' AND class_t.language = '{{{lang|en}}}' | |||
AND faction_t.type = 'faction' AND faction_t.language = '{{{lang|en}}}' | |||
|fields = H.id = id, | |||
hero_t.name = name, | |||
motto_t.description = motto, | |||
hero_t.description = biography, | |||
class_t.name = class, | |||
faction_t.name = faction, | |||
H.class_type = class_type, | |||
H.icon = icon, | |||
H.specialization_id = specialization_id, | |||
COALESCE(H.offence, HC.offence) = startattack, | |||
COALESCE(H.defence, HC.defence) = startdefense, | |||
COALESCE(H.spell_power, HC.spell_power) = startspellpower, | |||
COALESCE(H.intelligence, HC.intelligence) = startknowledge | |||
|format = template | |||
|template= HeroInfoBox/base | |||
|named args = yes | |||
}}</includeonly> | |||
Revision as of 05:06, 15 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.
Zoran, the Self-Founded
[[File:{{{portrait}}}|300px]]
Waurmos are complex and intelligent creatures, but few of them stoop to finding personhood. This one did.
faction💬
No results
wiki_hero_class💬
No results
wiki_start_attributes💬
No results
No results
No results
No results
starting_skills💬
No resultsNo results
starting_spells💬
wiki_none💬
starting_army💬
No results
wiki_internal_id💬
demon_hero_4
{{HeroInfoBox|lang=en|id=demon_hero_4}}


