Difference between revisions of "Template:Infobox general"

From Cube Life: Island Survival Wiki
Jump to: navigation, search
m
m
 
Line 31: Line 31:
 
! colspan="2" class="infoboxdetails" | Details
 
! colspan="2" class="infoboxdetails" | Details
 
|-
 
|-
{{#if: {{{Item Type|}}} | {{!}} style="width:50%;" {{!}} <div>Item Type</div> {{!!}} {{{Item Type}}} }}
+
{{#if: {{{Item Type|}}} |
 
{{!}} style="width:50%;" {{!}} <div>Item Type</div>
  +
{{!}} style="width:50%;" {{!}} {{{Item Type}}} }}
 
|-
 
|-
 
{{#if: {{{Crafting Grid|}}} | {{!}} <div>Crafting Grid</div> {{!!}} {{{Crafting Grid}}} }}
 
{{#if: {{{Crafting Grid|}}} | {{!}} <div>Crafting Grid</div> {{!!}} {{{Crafting Grid}}} }}
 
|-
 
|-
  +
{{#if: {{{Glows|}}} |
{{#if: {{{Glows|}}} | {{!}} style="width:50%;" {{!}} <div>Light Source</div> {{!!}} {{pushpin|{{{Glows|}}} }} }}
 
  +
{{!}} style="width:50%;" {{!}} <div>Light Source</div>
 
{{!}} style="width:50%;" {{!}} {{pushpin|{{{Glows|}}} }} }}
 
|-
 
|-
 
{{#if: {{{AC|}}} | {{!}} style="width:50%;" {{!}} <div>AC</div> {{!!}} {{{AC}}} }}
 
{{#if: {{{AC|}}} | {{!}} style="width:50%;" {{!}} <div>AC</div> {{!!}} {{{AC}}} }}
 
|-
 
|-
{{#if: {{{Tradeble|}}} | {{!}} style="width:50%;" {{!}} <div>Tradeble</div> {{!!}} {{pushpin|{{{Tradeble|}}} }} }}
+
{{#if: {{{Tradeble|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Tradeble</div>
  +
{{!}} style="width:50%;" {{!}} {{pushpin|{{{Tradeble|}}} }} }}
 
|-
 
|-
 
{{#if: {{{Max_capacity|}}} | {{!}} <div>Max.&nbsp;capacity</div> {{!!}} {{{Max_capacity}}} }}
 
{{#if: {{{Max_capacity|}}} | {{!}} <div>Max.&nbsp;capacity</div> {{!!}} {{{Max_capacity}}} }}
Line 47: Line 53:
 
! colspan="2" class="infoboxdetails" | Damage Profiles
 
! colspan="2" class="infoboxdetails" | Damage Profiles
 
|-
 
|-
{{#if: {{{Damage|}}} | {{!}} style="width:50%;" {{!}} <div>Damage</div> {{!!}} {{{Damage}}} }}
+
{{#if: {{{Damage|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Damage</div>
  +
{{!}} style="width:50%;" {{!}} {{{Damage}}} }}
 
|-
 
|-
{{#if: {{{Mob Damage|}}} | {{!}} style="width:50%;" {{!}} <div>Mob Damage</div> {{!!}} {{{Mob Damage}}} }}
+
{{#if: {{{Mob Damage|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Mob Damage</div>
  +
{{!}} style="width:50%;" {{!}} {{{Mob Damage}}} }}
 
|-
 
|-
{{#if: {{{Wood Damage|}}} | {{!}} style="width:50%;" {{!}} <div>Wood Damage</div> {{!!}} {{{Wood Damage}}} }}
+
{{#if: {{{Wood Damage|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Wood Damage</div>
  +
{{!}} style="width:50%;" {{!}} {{{Wood Damage}}} }}
 
|-
 
|-
{{#if: {{{Stone Damage|}}} | {{!}} style="width:50%;" {{!}} <div>Stone Damage</div> {{!!}} {{{Stone Damage}}} }}
+
{{#if: {{{Stone Damage|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Stone Damage</div>
  +
{{!}} style="width:50%;" {{!}} {{{Stone Damage}}} }}
 
|-
 
|-
  +
{{#if: {{{HP|}}} |
{{#if: {{{HP|}}} | {{!}} style="width:50%;" {{!}} <div>HP (Durability)</div> {{!!}} {{{HP}}} }}
 
  +
{{!}} style="width:50%;" {{!}} <div>HP (Durability)</div>
  +
{{!}} style="width:50%;" {{!}} {{{HP}}} }}
 
|-
 
|-
{{#if: {{{Item Drop Chance|}}} | {{!}} style="width:50%;" {{!}} <div>Item drop chance </div> {{!!}} {{{Item Drop Chance}}} }}
+
{{#if: {{{Item Drop Chance|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Item drop chance </div>
  +
{{!}} style="width:50%;" {{!}} {{{Item Drop Chance}}} }}
 
|-
 
|-
 
{{#if:{{{Foodbonus|}}}{{{Water bonus|}}}|
 
{{#if:{{{Foodbonus|}}}{{{Water bonus|}}}|
Line 63: Line 81:
 
}}
 
}}
 
|-
 
|-
{{#if: {{{Foodbonus|}}} | {{!}} style="width:50%;" {{!}} <div>Food Bonus</div> {{!!}} {{{Foodbonus}}} }}
+
{{#if: {{{Foodbonus|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Food Bonus</div>
  +
{{!}} style="width:50%;" {{!}} {{{Foodbonus}}} }}
 
|-
 
|-
{{#if: {{{Water bonus|}}} | {{!}} style="width:50%;" {{!}} <div>Water Bonus</div> {{!!}} {{{Water bonus}}} }}
+
{{#if: {{{Water bonus|}}} |
  +
{{!}} style="width:50%;" {{!}} <div>Water Bonus</div>
  +
{{!}} style="width:50%;" {{!}} {{{Water bonus}}} }}
 
|-
 
|-
 
{{#if:{{{next|}}}{{{previous|}}}{{{seealso|}}}{{{ID|}}}|
 
{{#if:{{{next|}}}{{{previous|}}}{{{seealso|}}}{{{ID|}}}|

Latest revision as of 13:27, 11 February 2021

"{{{name}}}"
Details
Damage Profiles
Template-info.png Documentation

This is just a generic infobox with a few sample fields

Template structure

  • Fields are defined using triple curly brackets, like this: {{{fieldname}}}
<!-- This is a comment. Any template text bracketed this way is not used -->

{| class="infoboxtable" <!-- this class declaration tells the wiki this table is an infobox, and is based on css found in [[Mediawiki:Hydra.css]] -->
|-
! colspan="2" class="infoboxname" <!-- this class declaration tells the wiki this this row has special formatting --> |  "{{{name}}}" <!-- this tells the wiki to insert the contents of a field called "name" here -->
|-
{{#if: {{{image|}}} | ! colspan="2" {{!}} [[File:{{{image}}}|250x250px]] | <includeonly>[[Category:Infoboxes lacking images]]</includeonly>}} <!-- this row uses logic. It asks whether or not a field called "image" was specified, and if it was, then it places the content of the field in an image call which spans both columns of the infobox table. If there is no image specified, then it adds the page to a category called "Infoboxes lacking images" ->
|-
! colspan="2" class="infoboxdetails" <!-- this class declaration tells the wiki this this row has special formatting --> | Details 
|-
{{#if: {{{race|}}} | {{!}} width=80 {{!}} <div>Race</div> {{!!}} {{{race}}} }} <!-- this row is one of the main data rows in the infobox. It checks to see if a parameter named "race" exists, and if it does, it puts a label called "Race" in the left column and the content of the race parameter in the right column. -->
|-
{{#if: {{{location|}}} | {{!}} <div>Location(s)</div> {{!!}} {{{location}}} }}
|-
{{#if: {{{source|}}} | {{!}} <div>Source</div> {{!!}} {{{source}}} }}
|-
{{#if: {{{reward|}}} | {{!}} <div>Reward</div> {{!!}} {{{reward}}} }}
|-
{{#if: {{{related|}}} | {{!}} <div>Related</div> {{!!}} {{{related}}} }}
|-
{{#if: {{{ID|}}} | {{!}} <div>ID</div> {{!!}} {{{ID}}} }}
|}

Usage

{{Infobox_example
| name     = 
| image    = 
| race     = 
| location = 
| source   = 
| reward   = 
| related  = 
| ID       =
}}

Example

"Hydra guy"
Details
Damage Profiles
See Also
ID
HYD1
{{Infobox_example
| name     = Hydra guy
| image    = Curse hydra.png
| race     = Plushie
| location = Curse Headquarters
| source   = [[User:Encredechine{{!}}Encredechine]]
| reward   = Feeling great
| related  = Fun
| ID       = HYD1
}}