Template:HeroInfoBox: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
Revamped scalar cargo query call
No edit summary
Line 4: Line 4:
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.
The language will be passed to all subsequent templates.  The main display code for this infobox is in [[Template:HeroInfoBox/base]], which itself calls multiple sub-templates for looking up terms and displaying dynamic data.
   
   


{{HeroInfoBox|lang=en|id=demon_hero_4}}
<code><nowiki>{{HeroInfoBox|id=human_hero_13|lang=en}}</nowiki></code>
 
<code><nowiki>{{HeroInfoBox|id=human_hero_13|lang=pl}}</nowiki></code>
 
 
{{HeroInfoBox|id=human_hero_13|lang=en}}
{{HeroInfoBox|id=human_hero_13|lang=pl}}
 
 
 


<code><nowiki>{{HeroInfoBox|lang=en|id=demon_hero_4}}</nowiki></code>
{{clear}}
{{clear}}
</noinclude><includeonly>{{#cargo_query:
</noinclude><includeonly>{{#cargo_query:
  tables  = Hero=H, HeroClass=HC, Faction=F,
  tables  = Hero=H, HeroClass=HC, Faction=F,
           Translation=hero_t, Translation=motto_t, Translation=class_t, Translation=faction_t
           Translation=hero_t, Translation=hero_en, Translation=motto_t
|join on = H.class_id = HC.id,
|join on = H.class_id = HC.id,
           H.faction  = F.id,
           H.faction  = F.id,
           H.id      = hero_t.target_id,
           H.id      = hero_t.target_id,
           H.id      = motto_t.target_id,
           H.id      = hero_en.target_id,
          HC.id      = class_t.target_id,
           H.id      = motto_t.target_id
           F.id      = faction_t.target_id
|where  = H.id = '{{{id|}}}'
|where  = H.id = '{{{id|}}}'
           AND hero_t.type    = 'hero'      AND hero_t.language    = '{{{lang|en}}}'
           AND hero_t.type    = 'hero'      AND hero_t.language    = '{{{lang|en}}}'
          AND hero_en.type  = 'hero'      AND hero_en.language  = 'en'
           AND motto_t.type  = 'hero_motto' AND motto_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,
|fields  = H.id                                      = id,
          hero_t.language                          = lang,
           hero_t.name                              = name,
           hero_t.name                              = name,
          CONCAT(hero_en.name,'.png')              = portrait,
           motto_t.description                      = motto,
           motto_t.description                      = motto,
           hero_t.description                        = biography,
           hero_t.description                        = biography,
           class_t.name                              = class,
           H.class_id                                = class,
           faction_t.name                            = faction,
           H.faction                                = faction,
          H.class_type                              = class_type,
          H.icon                                    = icon,
          H.specialization_id                      = specialization_id,
           COALESCE(H.offence, HC.offence)          = startattack,
           COALESCE(H.offence, HC.offence)          = startattack,
           COALESCE(H.defence, HC.defence)          = startdefense,
           COALESCE(H.defence, HC.defence)          = startdefense,

Revision as of 07:47, 16 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 be passed to all subsequent templates. The main display code for this infobox is in Template:HeroInfoBox/base, which itself calls multiple sub-templates for looking up terms and displaying dynamic data.


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

{{HeroInfoBox|id=human_hero_13|lang=pl}}


Lia the Untethered One
A human soul is vast — rise in the Church, and shed the body’s chains.
Faction
Hero Class
Starting Attributes
Attack 1
Starting Skills
Starting Spells
Starting Army
Internal ID
human_hero_13
Lia Nieokiełznana
Ludzka dusza nie ma granic — odnajdź drogę w Kościele i zrzuć cielesne okowy.
Frakcja
Klasa
Starting Attributes💬
Umiejętności początkowe
Zaklęcia początkowe
Armia początkowa
Wewnętrzne ID
human_hero_13