Template:Resource infobox: Difference between revisions
From Corsair Cove Official Wiki
Started a resource infobox with title, icon, category, a place for stats, and then lists for where it's made and what it's used to make |
m →Copypasta: Added comment to copypasta about the parameters so the link travels with the copypasta |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><div class="cc-infobox-resource" style="max-width: 360px; float: right;"><!-- | <includeonly><!-- | ||
--><div class="cc-infobox-resource-header" style="display: flex; align-items: center; gap: 12px;"><!-- | --><div class="cc-infobox-resource" style="max-width: 360px; float: right;"><!-- | ||
---->[[File:{{{icon_filename|Filename}}}|x48px|link=|{{{title|Resource}}}]]<!-- | ----><hr><!-- | ||
----><span style="display: flex; flex-direction: column;"><!-- | ----><div class="cc-infobox-resource-header" style="display: flex; align-items: center; gap: 12px;"><!-- | ||
------><span style="font-size: 1.75em;">{{{title|Resource}}}</span><!-- | -----><span class="cc-infobox-resource-header-title">[[File:{{{icon_filename|Filename}}}|x48px|link=|{{{title|Resource}}}]]</span><!-- | ||
------><span style="font-size: 1.25em; color: #ecaf4d;">{{{category|Category}}}</span><!-- | ------><span style="display: flex; flex-direction: column;"><!-- | ||
----></span><!-- | --------><span style="font-size: 1.75em;">{{{title|Resource}}}</span><!-- | ||
--></div><!-- | --------><span style="font-size: 1.25em; color: #ecaf4d;">{{{category|Category}}}</span><!-- | ||
--><div> | ------></span><!-- | ||
{{{stats_list| | ----></div><!-- | ||
--></div><!-- | ----><hr><!-- | ||
--><div class="cc-infobox-resource-footer">Produced By | ----><div> | ||
{{#if: {{{description|}}} | {{{description}}} }} | |||
{{#if: {{{stats_list|}}} | {{{stats_list}}} }}<!-- | |||
----></div><!-- | |||
----><div class="cc-infobox-resource-footer"><!-- | |||
------><span class="cc-infobox-resource-footer-label">Produced By</span> | |||
<hr> | <hr> | ||
{{{produced_by_list| | {{{produced_by_list|None}}}<!-- | ||
--></div><!-- | ----></div><!-- | ||
--><div class="cc-infobox-resource-footer">Used to Make | ----><div class="cc-infobox-resource-footer"><!-- | ||
------><span class="cc-infobox-resource-footer-label">Used to Make</span> | |||
<hr> | <hr> | ||
{{{makes_list| | {{{makes_list|Nothing}}}<!-- | ||
--></div> | ----></div><!-- | ||
</div></includeonly><noinclude> | --></div></includeonly><noinclude> | ||
Generates an infobox for a resource with the specified information. | |||
== Usage == | |||
{|class="wikitable" | |||
! Parameter !! Purpose | |||
|- | |||
| <code>title=</code> || the name of the resource | |||
|- | |||
| <code>icon_filename=</code> || the filename and extension of the image to use | |||
|- | |||
| <code>category=</code> || the category to display under the name of the resource, for example, "Construction Resource" | |||
|- | |||
| <code>description=</code> || the flavor text for the resource | |||
|- | |||
| <code>stats_list</code> || a list of stats to display in the middle, with open-ended formatting, but an unordered list is guaranteed to work with the style sheet: start each list item with <code>*</code> on a new line after <code>|stats_list=</code> | |||
* to properly format | |||
* each list item | |||
|- | |||
| <code>produced_by_list=</code> || same as stats; be sure to include any icon with the <code><nowiki>[[File:]]</nowiki></code> markup tag | |||
|- | |||
| <code>makes_list</code> || same as stats; use a list, even if it's only one item | |||
|} | |||
=== Example === | |||
{{Resource infobox | {{Resource infobox | ||
| Line 24: | Line 56: | ||
|icon_filename=T_ICO_resource_plank.png | |icon_filename=T_ICO_resource_plank.png | ||
|category=Construction Resource | |category=Construction Resource | ||
|description=Rough or finished timber. For bulding anything from shelves to ships. | |||
|stats_list= | |stats_list= | ||
* | * Warehouse stack size: 250 | ||
|produced_by_list= | |produced_by_list= | ||
* [[Sawmill]] | * [[File:T ICO resource plank.png|x16px|link=Sawmill|Sawmill]] [[Sawmill]] | ||
* Base production per minute: 10 | |||
* Requires: 4 [[File:T_ICO_resource_Hardwood.png|x16px|link=Hardwood|Hardwood]] [[Hardwood]] | |||
|makes_list= | |makes_list= | ||
* Most buildings | * Most buildings | ||
* All ships | * All ships | ||
}} | }} | ||
<pre>{{Resource infobox | |||
|title=Planks | |||
|icon_filename=T_ICO_resource_plank.png | |||
|category=Construction Resource | |||
|description=Rough or finished timber. For bulding anything from shelves to ships. | |||
|stats_list= | |||
* Warehouse stack size: 250 | |||
|produced_by_list= | |||
* [[File:T ICO resource plank.png|x16px|link=Sawmill|Sawmill]] [[Sawmill]] | |||
* Base production per minute: 10 | |||
* Requires: 4 [[File:T_ICO_resource_Hardwood.png|x16px|link=Hardwood|Hardwood]] [[Hardwood]] | |||
|makes_list= | |||
* Most buildings | |||
* All ships | |||
}}</pre> | |||
=== Copypasta === | |||
Copy and paste this at the top of any article on a specific resource: | |||
<pre><!--Parameters are explained at https://wiki.hoodedhorse.com/Corsair_Cove/Template:Resource_infobox-->{{Resource infobox | |||
|title= | |||
|icon_filename= | |||
|category= | |||
|description= | |||
|stats_list= | |||
* | |||
|produced_by_list= | |||
* | |||
|makes_list= | |||
* | |||
}}</pre> | |||
[[Category: Infobox templates]] | |||
</noinclude> | </noinclude> | ||
Latest revision as of 17:34, 26 July 2026
Generates an infobox for a resource with the specified information.
Usage
| Parameter | Purpose |
|---|---|
title= |
the name of the resource |
icon_filename= |
the filename and extension of the image to use |
category= |
the category to display under the name of the resource, for example, "Construction Resource" |
description= |
the flavor text for the resource |
stats_list |
stats_list=
|
produced_by_list= |
same as stats; be sure to include any icon with the [[File:]] markup tag
|
makes_list |
same as stats; use a list, even if it's only one item |
Example
Rough or finished timber. For bulding anything from shelves to ships.
- Warehouse stack size: 250
{{Resource infobox
|title=Planks
|icon_filename=T_ICO_resource_plank.png
|category=Construction Resource
|description=Rough or finished timber. For bulding anything from shelves to ships.
|stats_list=
* Warehouse stack size: 250
|produced_by_list=
* [[File:T ICO resource plank.png|x16px|link=Sawmill|Sawmill]] [[Sawmill]]
* Base production per minute: 10
* Requires: 4 [[File:T_ICO_resource_Hardwood.png|x16px|link=Hardwood|Hardwood]] [[Hardwood]]
|makes_list=
* Most buildings
* All ships
}}
Copypasta
Copy and paste this at the top of any article on a specific resource:
<!--Parameters are explained at https://wiki.hoodedhorse.com/Corsair_Cove/Template:Resource_infobox-->{{Resource infobox
|title=
|icon_filename=
|category=
|description=
|stats_list=
*
|produced_by_list=
*
|makes_list=
*
}}


