Wiki

Template:Infocard: Difference between revisions

From 2D Tower Wiki
This page was last edited on 7 September 2026, at 06:42.
Create reusable Infocard template with title, icon, and text parameters
 
Fix Infocard list rendering and document HTML list content
Line 5: Line 5:
* <code>name</code> - card title.
* <code>name</code> - card title.
* <code>icon</code> - optional image filename, displayed on the right. For example: <code>Example.png</code>.
* <code>icon</code> - optional image filename, displayed on the right. For example: <code>Example.png</code>.
* <code>text</code> - card content, including wiki markup.
* <code>text</code> - card content. Use normal text or HTML/wiki markup such as <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code> for lists.


Example:
Example:
Line 11: Line 11:
|name=Mechanics
|name=Mechanics
|icon=Example.png
|icon=Example.png
|text=
|text=&lt;ul&gt;
* [[Maps]]
&lt;li&gt;[[Maps]]&lt;/li&gt;
* [[Tenants]]
&lt;li&gt;[[Tenants]]&lt;/li&gt;
&lt;/ul&gt;
}}</pre>
}}</pre>
</noinclude>
</noinclude>
Line 22: Line 23:
{{#if:{{{icon|}}}|<div style="flex:0 0 auto;">[[File:{{{icon}}}|64px|alt={{{name|}}} icon|link=]]</div>}}
{{#if:{{{icon|}}}|<div style="flex:0 0 auto;">[[File:{{{icon}}}|64px|alt={{{name|}}} icon|link=]]</div>}}
</div>
</div>
<div>{{{text|}}}</div>
<div class="tower-infocard-content">{{{text|}}}</div>
</div>
</div>
</includeonly>
</includeonly>

Revision as of 06:42, 7 September 2026

This template creates a tower information card.

Parameters:

  • name - card title.
  • icon - optional image filename, displayed on the right. For example: Example.png.
  • text - card content. Use normal text or HTML/wiki markup such as <ul> and <li> for lists.

Example:

{{Infocard
|name=Mechanics
|icon=Example.png
|text=<ul>
<li>[[Maps]]</li>
<li>[[Tenants]]</li>
</ul>
}}