Cube Life: Island Survival Wiki
Line 15: Line 15:
 
! colspan="2" class="infoboxdetails" <!-- this class declaration tells the wiki this this row has special formatting --> | Details
 
! 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 -->
+
{{#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 put 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: {{{location|}}} | {{!}} <div>Location(s)</div> {{!!}} {{{location}}} }}

Revision as of 11:26, 17 August 2018

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 put 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

Template:Infobox example

{{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
}}

This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.