Difference between revisions of "Template:Autoinfobox zkunit"

From Zero-K
Jump to navigation Jump to search
m (Try getting the image by defname.)
(Allow first argument to be anonymous and assumed to be the defname... because why not?)
Line 1: Line 1:
 
<includeonly>{{ Infobox zkunit
 
<includeonly>{{ Infobox zkunit
 
<!-- Required fields -->
 
<!-- Required fields -->
|defname = {{{defname}}}
+
|defname = {{{defname|{{{1|}}}}}}
 
|name = {{{name|{{#invoke:UnitData|getData|{{{defname}}}|name}}}}}
 
|name = {{{name|{{#invoke:UnitData|getData|{{{defname}}}|name}}}}}
 
<!-- Optional fields -->
 
<!-- Optional fields -->

Revision as of 21:14, 2 September 2024


Template documentation[view] [edit] [history] [purge]

This template uses Module:UnitData to autogenerate unit infoboxes, transcluding and filling in Template:Infobox zkunit data from Module:UnitData/data. Specific tags can be overridden by manually specifying them, if necessary.

Example usage:

{{Autoinfobox zkunit
|defname=striderdetriment
|name=Name override
}}

The module can also be invoked directly without this template to generate an infobox (note that output may not be identical in some cases; observed with automatic detection of buildpic on Reef):

{{#invoke:UnitData|printInfobox|defname=striderdetriment|name=Name override}}

When invoking from module, defname may be passed as an anonymous parameter instead.

For more information, see the module page.