Help:Useful Templates

From Heroes of Might and Magic: Olden Era Official Wiki
Revision as of 03:34, 20 May 2026 by Ketura (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Cargo and Structured Data
Documentation Data Overview • Introduction to Cargo • Game Files • Obelisk Bot

Building Cargo Templates • Building Rich Tables • Debugging Cargo • Searching Cargo Tables • Using Translations

Useful Recipes • Useful Templates

Architecture Reference Data Architecture • Data:Coverage • Cargo Definition Pages • Game Data Pages

All Cargo Tables • Artifacts • Buildings • Heroes • Factions • Laws • MapObjects • Skills • Spells • Translations • Units

External Links Official Cargo Extension Documentation • SQL References



This article is a stub. You can help this wiki by expanding it.

The templates used here may be useful specifically when creating Cargo-aware templates, tables, or pages.

!

As any intermediary template wizard can attest, once you start stuffing templates into other templates the syntax can get complicated fast. {{!}} will insert a pipe symbol, but because of the order in which it is processed, this will happen after expressions and such have executed. If you find that your templates are eating each other, you probably need {{!}} somewhere.


A or an

Template:A or an can be used on English-specific pages to check whether dynamic data should be preceded by "a" or "an".


clear

Template:Clear is most often used around infoboxes. When invoked, it will push the next text down below all prior article text, meaning that it will clear the bottom of any vertical infoboxes on the side.

{{clear}}


F

Template:F, short for "Faction", this will insert the associated faction's icon and article link; this can be used either in infoboxes or inline. It supports both English terms ("Temple") and internal faction names ("human"). If you pass in a language code in the second parameter, it will render the name in that language.

"creatures of the {{F|Temple}} faction".

"creatures of the Temple faction".

"creatures of the {{F|Temple|pl}} faction".

"creatures of the Świątynia faction".


Label

Template:Label will look up specifically community-translated terms which have been saved using Data:WikiTranslations. Pass in the target_id of the concept along with the language, and that term will be properly retrieved and rendered.

If you want official translated terms, instead use Template:Link.


{{Label|hero_class|en}}

Hero Class

{{Label|hero_class|en|nolink}}

Hero Class

{{Label|hero_class|pl}}

Klasa


Link

Template:Link looks up a term in the Translation Cargo table and links to the appropriate article in the requested language. If "nolink" is provided, it will instead just render the term itself with no link.


{{Link|type=faction|id=human}}

Temple

{{Link|type=ui|id=starting_army|nolink}}

Starting Army

{{Link|type=faction|id=human|lang=pl}}

Świątynia


LinkIcon

The basis for Template:F, Template:LinkIcon will like Link look up a particular term in the Translation table and construct a link to that article. Unlike Link, it will also attempt to interpret the English name as a filename and render an icon; if the filename is not exact, you can provide a suffix to append to the English name.


{{LinkIcon|type=faction|id=human|suffix=_icon.png}}

Temple

{{LinkIcon|type=faction|id=human|suffix=_icon.png|lang=pl}}

Świątynia


MediumIconDisplay

Useful for infoboxes, Template:MediumIconDisplay will take a provided term, article, and filename and render an icon next to text. This template is not language-aware, so you will have to perform the translation yourself.

{{MediumIconDisplay|filename=Hive_icon|pagelink=Hive|name=Example Linked Text}}

Example Linked Text Example Linked Text

{{MediumIconDisplay|filename=Hive_icon|name=Example Unlinked Text}}

Example Unlinked Text Example Unlinked Text


MediumIconThumbDisplay

Suitable for creature counts, Template:MediumIconThumbDisplay renders an icon and link to a page, with unlinked text rendered underneath.

{{MediumIconThumbDisplay|filename=skeleton_icon|pagelink=Skeleton|text=16-29}}


16-29


Quote

Template:Quote renders a block of text, with or without a separate title and with or without a decorating icon. The background and border can also be customized.


Test Info
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


This template is the basis for several others, such as Template:Biography.