Template:Infobox: Difference between revisions

From Lifecraft Wiki
Jump to navigation Jump to search
(Created page with "{| class="wikitable" style="float:right;width:300px" ! colspan="2" | {{{name|Name}}} |- {{#if:{{{picture_file|}}}| <tr><td colspan="2">[[{{{picture_file}}}|frameless|x250px|center|alt={{{picture_alt|}}}|{{{picture_caption|}}}]]</td></tr> | }} | style="width:75px;vertical-align:top" | Category | {{{categories|{{category|Uncategorized}}}}} |- | style="vertical-align:top" | Features | {{{features|No features}}} |- | style="vertical-align:top" | Build on | {{{floor|Void}}} |}")
 
m (Fix check of features parameter)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable" style="float:right;width:300px"
<includeonly>{| class="wikitable" style="float:right;width:300px;margin:0px 10px"
! colspan="2" | {{{name|Name}}}
! colspan="2" | {{{name|Name}}}
|-
|-
Line 9: Line 9:
| {{{categories|{{category|Uncategorized}}}}}
| {{{categories|{{category|Uncategorized}}}}}
|-
|-
| style="vertical-align:top" | Features
{{#ifeq:{{{features|undefined}}}|undefined||
| {{{features|No features}}}
<tr><td style="vertical-align:top">Features</td><td>{{{features}}}</td></tr>
}}
{{#ifeq:{{{build_req|undefined}}}|undefined||
<tr><td style="vertical-align:top">Build req.</td><td>{{{build_req}}}</td></tr>
}}
|}</includeonly>
<noinclude>
Generic infobox for game elements (building, resources, ...)
== Parameters ==
{| class="wikitable" style="margin:auto;width:800px"
! Name
! Description
|-
|-
| style="vertical-align:top" | Build on
| name
| {{{floor|Void}}}
| Name of the game element.
|-
| categories
| Categories of the game element (type, category, color, ...). Feel free to use one or multiple element with the [[Template:Category|categories template]].
|-
| picture_file
| (optional) File use to illustrate the infobox. Format: File:filename.ext.
|-
| picture_alt
| (optional) Alternative text use if the picture can't load.
|-
| picture_caption
| (optional) Text display while hovering the picture.
|-
| features
| (optional) Features of the game element (like: producing heat, need energy, ...). Feel free to use one or multiple element with the [[Template:IconText|icon-text template]].
|-
| build_req
| (optional) Define condition for a structure to be build (floor type, on wall, ...). Feel free to use one or multiple element with the [[Template:IconText|icon-text template]].
|}
|}
== Exemple of use ==
<nowiki>{{Infobox</nowiki> <br/>
| name=Ribosome <br/>
| categories=<nowiki>{{category|Structure}}{{category|Production}}</nowiki><br/>
| picture_file=File:Ribosome.png<br/>
| picture_alt=Ribosome<br/>
| picture_caption=Ribosome<br/>
| features=<nowiki>{{icontext|icon=heating|text=Produce heat|oneline}}</nowiki><br/>
| build_req=<nowiki>{{icontext|icon=intracell|text=Intracellular|oneline}}</nowiki><br/>
}}
</noinclude>

Latest revision as of 08:04, 28 May 2024


Generic infobox for game elements (building, resources, ...)

Parameters

Name Description
name Name of the game element.
categories Categories of the game element (type, category, color, ...). Feel free to use one or multiple element with the categories template.
picture_file (optional) File use to illustrate the infobox. Format: File:filename.ext.
picture_alt (optional) Alternative text use if the picture can't load.
picture_caption (optional) Text display while hovering the picture.
features (optional) Features of the game element (like: producing heat, need energy, ...). Feel free to use one or multiple element with the icon-text template.
build_req (optional) Define condition for a structure to be build (floor type, on wall, ...). Feel free to use one or multiple element with the icon-text template.

Exemple of use

{{Infobox
| name=Ribosome
| categories={{category|Structure}}{{category|Production}}
| picture_file=File:Ribosome.png
| picture_alt=Ribosome
| picture_caption=Ribosome
| features={{icontext|icon=heating|text=Produce heat|oneline}}
| build_req={{icontext|icon=intracell|text=Intracellular|oneline}}
}}