Template:Infobox block: Difference between revisions

well, this works. testing time.....
No edit summary
 
(407 intermediate revisions by 70 users not shown)
Line 1: Line 1:
<table class="infobox" cellpadding="4" style="width: 22em; font-size: 90%; float:right; border: 1px solid #AAAAAA; margin:0.5em">
{{#invoke:infobox|infobox
<tr>
| invimage = title
  <td align="center" colspan=2 bgcolor="#CCCCCC" style="font-size:120%; font-weight: bold;">{{{name|{{BASEPAGENAME}}}}}</td>
| rows =
</tr>
{{#if: {{{rarity|}}} | {{infobox row|class=list-style-none|label=[[minecraft:Rarity|Rarity color]]|field={{ucfirst:{{{rarity|}}}}} }} | }}
<tr valign="top">
{{#if: {{{renewable|}}} | {{infobox row|label=[[minecraft:Renewable resource|Renewable]]|field={{{renewable}}} }} }}
  <td align="center" colspan="2">[[image:{{{image|No image.png}}}|150px|center]]</td>
{{#if: {{{stackable|}}} | {{infobox row|label=Stackable|field={{{stackable}}} {{#if: {{{maxStack|}}} | &nbsp;({{{maxStack}}}) }} }} |<!-- {{{stackable}}} not provided => --->{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing stackability}}}} }}
</tr>
{{infobox row|label=Tool{{ #if: {{{tool2|}}} | s }}|class=pixel-image|field={{{tool|}}}{{
{{Block/row|label=Type|field={{{type|?}}}}}
  #if: {{{tool2|}}} | {{{tool2|}}}
{{#switch:{{lc:{{{type}}}}}|solid block|solid|block =
}}{{
{{Block/row|label=Requires sunlight/dirt?|field={{{dirt|?}}}}}
  #if: {{{tool3|}}} | {{{tool3|}}}
}}
}} }}
{{Block/row|label=Affected by gravity?|field={{{gravity|?}}}}}
{{infobox row|label=[[minecraft:Explosion#Blast resistance|Blast resistance]]|field={{ #if: {{{tntres|}}}
{{Block/row|label=Allows light to pass through?|field={{{transparent|?}}}}}
| {{{tntres}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden tntres}} }}
{{Block/row|label=Emits Light?|field={{{light|?}}}}}
| {{Blast resistance values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
{{Block/row|label=Tool to use|field={{{Tool|[[image:{{{image|UnknownTool.png}}}]]}}}}}
}} }}
{{#switch:{{lc:{{{type}}}}}|fluid =
{{infobox row|label=[[minecraft:Breaking#Blocks by hardness|Hardness]]|field={{ #if: {{{hardness|}}}
{{Block/row|label=Speed of fluid movement:|field={{{fluidspeed|?}}}}}
| {{{hardness}}}{{#if: {{NAMESPACE}} || {{translation category|project=0|Pages with overridden hardness}} }}
{{Block/row|label=Speed of walking through:|field={{{movespeed|?}}}}}
| {{Hardness values | {{#if: {{{title|}}} | {{{title}}} | {{#titleparts: {{BASEPAGENAME}} }} }} }}
}}
}} }}
<tr>
{{#if: {{{durability|}}} |{{infobox row|Durability|{{{durability|}}}}}}}
  <td style="white-space: nowrap; font-weight: bold;">Data Value</td>
{{infobox row|label=[[minecraft:Light|Luminous]]|field={{ #if: {{{light|}}} | {{{light}}} {{#if: {{{lightLevel|}}} | &nbsp;({{{lightLevel}}}) }} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing luminance}}}} }} }}
  <td style="white-space: nowrap;">{{{data|{{{datadec|?}}} <sub>dec</sub> ({{{datahex|?}}} <sub>hex</sub>)}}}</td>
{{infobox row|label=[[minecraft:Opacity|Transparent]]|field={{ #if: {{{transparent|}}} | {{{transparent}}} | ? {{#if: {{NAMESPACE}} || {{translation category|project=0|Missing transparency}}}} }} }}
</table><noinclude>
{{ #if: {{{waterloggable|}}} | {{infobox row|label=[[minecraft:Waterlogging|Waterloggable]]|field={{{waterloggable}}} }} }}
==Documentation==
{{ #if: {{{heals|}}} | {{infobox row|label=[[minecraft:Food|Restores]]|field={{{heals}}} }} }}
'''These usage notes will not be included in articles bearing this template.'''
{{infobox row|label=[[minecraft:Flammable|Flammable]]|field={{ #if: {{{flammable|}}} | {{{flammable}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing flammability}}}} }} }}
 
{{infobox row|label=Catches fire from [https://minecraft.wiki/w/Lava Lava]|field={{ #if: {{{lavasusceptible|}}} | {{{lavasusceptible}}} | ?{{#if: {{NAMESPACE}} || {{translation category|project=0|Missing lava susceptibility}}}} }} }} }}
This template provides a uniform design for block pages.
{{#if: {{NAMESPACE}} ||
<pre>
{{translation category|project=0|{{
{{Block
  #switch: {{lc: {{{renewable|}}} }}
| name =  
  | yes = Renewable resources
| image =
  | no = Non-renewable resources
| type =  
  | Resources with invalid renewability
| gravity =
}}}}
| dirt =
}}<noinclude>
| transparent =
{{documentation}}
| light =
<!-- Put categories/interwiki on the documentation page -->
| Tool =
</noinclude>
| datadec =  
| datahex =
}}</pre>
 
{| class=grid
! Parameter
! Function
! Default value
|-
| <code>name</code> || Name of the block || <code><nowiki>{{BASEPAGENAME}}</nowiki></code>
|-
| <code>image</code> || Image of the block (should be approx. 150x150px) || [[:File:No image.png|No image.png]]
|-
| <code>type</code> || Type(solid block, solid, block, or fluid) || ?
|-
| <code>gravity</code> || Affected by gravity? || ?
|-
| <code>dirt</code> || Requires sunlight/dirt? || ?
|-
| <code>transparent</code> || Allows light to pass through? || ?
|-
| <code>light</code> || Emits Light? || ?
|-
| <code>Tool</code> || Tool to use || [[:File:UnknownTool.png|UnknownTool.png]]
|-
| <code>datadec</code> || Decimal Data Value || ?
|-
| <code>datahex</code> || Hexadecimal Data Value || ?
|-
| <code>data</code> || Data Value (overrides dec and hex values) || <code>datadec</code> and <code>datahex</code>
|}
[[Category:Templates]]</noinclude>
<includeonly>{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[Category:Blocks]]}}</includeonly>