Difference between revisions of "Template:Infobox material"
From Captain of Industry Wiki
Thadius856 (talk | contribs) m (typo) |
m (Define size of the image) |
||
(34 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><templatestyles src="Template:Infobox material/styles.css" /><!-- | ||
--><div | -->{{#if:{{NAMESPACE}}||[[Category:Items]]}}<!-- | ||
--><div | --><div class="infobox-wrapper"><!-- | ||
--><div class="outer-box"><!-- | |||
** Title (Name of item) | |||
--><div class="inner-header"><!-- | |||
--><div class="title"><!-- | |||
-->{{#if: {{{Name|{{PAGENAME}}}}}<!-- | |||
-->| {{{Name|{{PAGENAME}}}}}<!-- | |||
** This variable is used in footer template ** | |||
-->{{#vardefine:game_object_type|material}}<!-- | |||
-->| Unknown Material }}<!-- | |||
--></div><!-- | |||
--></div><!-- | --></div><!-- | ||
--><div | |||
** Image and Description ** | |||
--><div class="inner-main"><!-- | |||
-->[[File:{{#if: {{{Image|}}} | {{{Image}}} | {{#if: {{{Name|{{PAGENAME}}}}} | {{{Name|{{PAGENAME}}}}} | Placeholder material}}.png}}|128px]]<br><!-- | |||
-->{{#if: {{{Description|}}} | <!-- | -->{{#if: {{{Description|}}} | <!-- | ||
--><div | --><div class="description">{{{Description}}}</div><!-- | ||
-->}}<!-- | -->}}<!-- | ||
--></div><!-- | --></div><!-- | ||
--><div | |||
--><div | |||
--><table | --><div class="inner-table"><!-- | ||
-->{{#if:{{{ | --><div class="inner-inner-table"><!-- | ||
--><tr | --><table class="table"><!-- | ||
--><td | |||
--><td | ** Type ** | ||
--></tr>}}<!-- | -->{{#if:{{{Type1|}}}|<!-- | ||
-->{{#if:{{{ | --><tr class="table-tr"><!-- | ||
--><tr | --><td class="table-td-left">Type</td><!-- | ||
--><td | --><td class="table-td-right"><!-- | ||
--><td | -->{{{Type1}}}{{#if:{{NAMESPACE}}||[[Category:{{{Type1}}}{{#switch:{{lc:{{{Type1}}}}}|food|pollution=|s}}]]}}<!-- | ||
--></tr>}}<!-- | -->{{#if: {{{Type2|}}} | <br>{{{Type2|}}}{{#if:{{NAMESPACE}}||[[Category:{{{Type2}}}{{#switch:{{lc:{{{Type2}}}}}|food|pollution=|s}}]]}}}}<!-- | ||
-->{{# | --></td><!-- | ||
--><tr | --></tr><!-- | ||
--><td | -->}}<!-- | ||
--><td | |||
--></tr>}}<!-- | ** State ** | ||
-->{{#if:{{{TransportedBy|}}}|<!-- | -->{{#if: {{{State|}}} |<!-- | ||
--><tr | --><tr class="table-tr"><!-- | ||
--><td | --><td class="table-td-left">State</td><!-- | ||
-->< | --><td class="table-td-right">{{{State}}}{{#if:{{NAMESPACE}}||[[Category:{{{State}}} products]]}}</td><!-- | ||
--></tr><!-- | |||
-->{{#if:{{{ | -->|[[Category:Missing state]]<!-- | ||
-->< | -->}}<!-- | ||
--><td | |||
** Radiation Level** | |||
-->{{#ifeq: {{{Radiation|0}}} | 0 ||<!-- | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Radiation Level</td><!-- | |||
--><td class="table-td-right">{{{Radiation}}}</td><!-- | |||
--></tr><!-- | |||
-->}}<!-- | |||
** Transported by ** | |||
-->{{#if:{{{TransportedBy|}}}{{{State|}}}|<!-- | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Transported by</td><!-- | |||
--><td class="table-td-right"><!-- | |||
-->{{#if: {{{TransportedBy|}}} |<!-- | |||
-->{{{TransportedBy}}}{{#if: {{NAMESPACE}} || [[Category:Items with unique transport or storage]] }} |<!-- | |||
-->{{#switch: {{lc:{{{State|}}}}} |<!-- | |||
-->| loose = {{variants|U-shape Conveyor}}<!-- | |||
-->{{#ifeq:{{{TrackTransport|yes}}} | no || <br>[[Pickup]]•[[Truck]]<br>[[Haul Truck (Dump)]] }}<!-- | |||
-->| fluid = {{variants|Pipe}}<!-- | |||
-->{{#ifeq:{{{TrackTransport|yes}}} | no || <br>[[Pickup]]•[[Truck]]<br>[[Haul Truck (Tank)]] }}<!-- | |||
-->| unit = {{variants|Flat Conveyor}}<!-- | |||
-->{{#ifeq:{{{TrackTransport|yes}}} | no || <br>[[Pickup]]•[[Truck]] }}<!-- | |||
-->| molten = [[Molten Channel]]<!-- | |||
-->| virtual = [[Virtual product|Magic]]<!-- | |||
-->| #default = <span style="color: red;">Unknown <nowiki>{{{State}}}</nowiki></span><!-- | |||
-->}}<!-- | |||
-->{{#if: {{{OtherTransport|}}} | <br>{{{OtherTransport}}}}}<!-- | |||
-->}}<!-- | |||
--></td><!-- | |||
--></tr><!-- | |||
-->}}<!-- | |||
** Stored in ** | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Stored in</td><!-- | |||
--><td class="table-td-right"><!-- | |||
-->{{#ifeq:{{lc:{{{StoredIn|}}}}} | none |<!-- | |||
-->None {{#if: {{NAMESPACE}} || [[Category:Unstorable items]] }} |<!-- | |||
-->{{#if:{{{StoredIn|}}}{{{State|}}}|<!-- | |||
-->{{#if: {{{StoredIn|}}} |<!-- | |||
-->{{{StoredIn}}}{{#if: {{NAMESPACE}} || [[Category:Items with unique transport or storage]] }} |<!-- | |||
-->{{#switch: {{lc:{{{State|}}}}} |<!-- | |||
-->| loose = {{variants|Loose Storage}}<!-- | |||
-->{{#ifeq: {{{StoredInShipyard|yes}}} | no ||<br>[[Shipyard]]}}<!-- | |||
-->{{#ifeq: {{{StoredInCargoModules|no}}} | yes |<br>{{variants|Loose Module}}}}<!-- | |||
-->| fluid = {{variants|Fluid Storage}}<!-- | |||
-->{{#ifeq: {{{StoredInShipyard|yes}}} | no ||<br>[[Shipyard]]}}<!-- | |||
-->{{#ifeq: {{{StoredInCargoModules|no}}} | yes |<br>{{variants|Fluid Module}}}}<!-- | |||
-->| unit = {{variants|Unit Storage}}<!-- | |||
-->{{#ifeq: {{{StoredInShipyard|yes}}} | no ||<br>[[Shipyard]]}}<!-- | |||
-->{{#ifeq: {{{StoredInCargoModules|no}}} | yes |<br>{{variants|Unit Module}}}}<!-- | |||
-->| molten = None<!-- | |||
-->| virtual = [[Virtual product|Ethereal plane]]<!-- | |||
-->| #default = <span style="color: red;">Unknown <nowiki>{{{State}}}</nowiki></span><!-- | |||
-->}}<!-- | |||
-->{{#if: {{{OtherStorage|}}} | <br>{{{OtherStorage}}}}}<!-- | |||
--></td><!-- | |||
--></tr><!-- | |||
-->}}<!-- | |||
-->}}}}<!-- | |||
** Created in ** | |||
-->{{#vardefine: CreatedInAuto | <!-- | |||
-->{{#cargo_query: tables=recipes | |||
| fields = Building | |||
| where = Building != "" AND Building IS NOT NULL | |||
AND ( Output1Name = "{{{Name|{{PAGENAME}}}}}" OR Output2Name = "{{{Name|{{PAGENAME}}}}}" | |||
OR Output3Name = "{{{Name|{{PAGENAME}}}}}" OR Output4Name = "{{{Name|{{PAGENAME}}}}}" | |||
OR Output5Name = "{{{Name|{{PAGENAME}}}}}" OR Output6Name = "{{{Name|{{PAGENAME}}}}}") | |||
| group by = Building | |||
| format = template | |||
| template = {{{template|Format link}}} | |||
| delimiter = <br> | |||
| default = {{#if:{{{CreatedIn|}}} || None }} | |||
}}<!-- | |||
-->}}<!-- | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Created in</td><!-- | |||
--><td class="table-td-right"><!-- | |||
-->{{#var: CreatedInAuto}}<!-- | |||
-->{{#if: {{#var: CreatedInAuto}} | {{#if: {{{CreatedIn|}}} | <br> }} }}<!-- | |||
-->{{{CreatedIn|}}}<!-- | |||
--></td><!-- | |||
--></tr><!-- | |||
** Used in ** | |||
-->{{#vardefine: UsedInAuto | <!-- | |||
-->{{#cargo_query: tables=recipes | |||
| fields = Building | |||
| where = Building != "" AND Building IS NOT NULL | |||
AND ( Input1Name = "{{{Name|{{PAGENAME}}}}}" OR Input2Name = "{{{Name|{{PAGENAME}}}}}" | |||
OR Input3Name = "{{{Name|{{PAGENAME}}}}}" OR Input4Name = "{{{Name|{{PAGENAME}}}}}" | |||
OR Input5Name = "{{{Name|{{PAGENAME}}}}}" OR Input6Name = "{{{Name|{{PAGENAME}}}}}") | |||
| group by = Building | |||
| format = template | |||
| template = {{{template|Format link}}} | |||
| delimiter = <br> | |||
| default = {{#if:{{{UsedIn|}}} || None }} | |||
}}<!-- | |||
-->}}<!-- | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Used in</td><!-- | |||
--><td class="table-td-right"><!-- | |||
-->{{#var: UsedInAuto}}<!-- | |||
-->{{#if: {{#var: UsedInAuto}} | {{#if: {{{UsedIn|}}} | <br> }} }}<!-- | |||
-->{{{UsedIn|}}}<!-- | |||
--></td><!-- | |||
--></tr><!-- | |||
** Starting amount** | |||
-->{{#if:{{{StartingQty|}}}|<!-- | -->{{#if:{{{StartingQty|}}}|<!-- | ||
--><tr | --><tr class="table-tr"><!-- | ||
--><td | --><td class="table-td-left">Starting amount</td><!-- | ||
--><td | --><td class="table-td-right">{{{StartingQty}}}</td><!-- | ||
--></tr>}}<!-- | --></tr>}}<!-- | ||
** Variants ** | |||
-->{{#if:{{{Variants|}}}|<!-- | |||
--><tr class="table-tr"><!-- | |||
--><td class="table-td-left">Variants</td><!-- | |||
--><td class="table-td-right">{{{Variants}}}</td><!-- | |||
--></tr>}}<!-- | |||
--></table><!-- | --></table><!-- | ||
--></div><!-- | --></div><!-- |
Latest revision as of 22:21, 25 May 2023
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
Construction Parts
Type | Crafted material |
State | Unit |
Transported by | Flat Conveyor [II•III] Pickup•Truck |
Stored in | Unit Storage [II•III•IV] Shipyard |
Created in | Assembly (Electric) Assembly (Electric) II Assembly (Manual) Assembly (Robotic) |
Used in | Assembly (Electric) Assembly (Electric) II Assembly (Manual) Assembly (Robotic) |
Starting amount | Sailor: 987 Captain: 654 Admiral: 321 |
Variants | Construction Parts II Construction Parts III Construction Parts IV |
Usage and Parameters
This is a template to show basic information of items. The template accepts the following parameters:
- Basic parameters
-
Name
: Name of items. (Default: The name of the page.)Type1
,Type2
: Types of items. It is used to categorize item in this wiki.State
: Loose, Fluid, Unit, Molten, or Virtual.Variants
: Variant of the items.
- Parameters for transportation
- Buildings and vehicles for transporting are automatically listed depending on State. But, it should be modified with the following parameters in some cases.
TrackTransport
: Set no if tracks cannot transport the item (Default: yes).TransportedBy
(rare): Only if transport override is needed.OtherTransport
(rare): To add an extra transport to auto-generated list.
- Parameters for storage
- Buildings for storing are automatically listed depending on State. But, it should be modified with the following parameters in some cases.
StoredInShipyard
: Set no if the shipyard cannot store the items (Default: yes).StoredInCargoModules
: Set yes if cargo modules can store the items (Default: no).StoredIn
: Only if storage override is needed. Set to "None" to suppress the field.OtherStorage
(rare): To add an extra storage to auto-generated list.
- Parameters for buildings that creates/uses this item
- Buildings that create/use the item are automatically listed from the table made by Template:Recipe define. But, it should be added with the following parameters in some cases.
CreatedIn
: To add an extra buildings to auto-generated list.UsedIn
: To add an extra buildings to auto-generated list.
- Miscellaneous parameters
-
Radiation
: Radiation Level of the items.StartingQty
: The number of the items stored in the Shipyard on game start.Image
(rare): Only if image override is needed.Description
(rare): To add an in-game description, though not currently implemented in-game.
Categories set by this template
- Category:Items: a category for all items applied this template
- Categories depending on
Type1
andType2
: example Category:Natural resources - Category:Unit products, Category:Loose products, Category:Fluid products, Category:Molten products, Category:Virtual products
- Category:Unstorable items: a category for items that cannot be stored any storage. (example Steam (High))
- Category:Items with unique transport or storage:
- A category for maintenance of the wiki. It is applied items which "Transported by" or "Stored in" is overridden manually. If there are too many items in this category, the automatic assignment of these parameters by this template should be updated.
Examples
- Example usage for standard item
Markup | Renders as | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Electronics III | Type1 = Crafted material | State = Unit | StartingQty = Sailor: 987<br>Captain: 654<br>Admiral: 321 | Variants = [[Electronics]]<br>[[Electronics II]] }} |
Electronics III
| ||||||||||||||||
- Example usage for items that tracks cannot transport or storage cannot store
Markup | Renders as |
---|---|
{{Infobox material | Name = Chilled Water | State = Fluid | TrackTransport = no | StoredIn = none }} |
|
- Example usage for items that the shipyard cannot store
Markup | Renders as | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Seawater | Type1 = Natural resource | State = Fluid | StoredInShipyard = no }} |
Seawater
| ||||||||||||
- Example usage for items having Radiation Level
Markup | Renders as | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Spent Fuel | Type1 = Radioactive waste | Radiation = 2 | State = Unit }} |
Spent Fuel
| ||||||||||||||
- Example usage for items stored in special storage
Markup | Renders as | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Spent Fuel | Type1 = Radioactive waste | State = Unit | StoredIn = [[Radioactive Waste Storage]] }} |
Spent Fuel
| ||||||||||||
- Example usage for items stored in cargo modules
Markup | Renders as | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Uranium Ore | Type1 = Natural resources | State = Loose | StoredInCargoModules = yes }} |
Uranium Ore
| ||||||||||||
- Example usage for items created/used in non-production-machines
Markup | Renders as | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{Infobox material | Name = Coal | Type1 = Natural resources | State = Loose | CreatedIn = [[Coal Mine]] | UsedIn = Foo }} |
Coal
| ||||||||||||
The above text is transcluded from Template:Infobox material/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Infobox material/doc. (View all subpages of this page.)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Infobox material/doc. (View all subpages of this page.)