Template:Item: Difference between revisions

2,794 bytes added ,  03:41, 3 May 2020
Restructured documentation a bit and added details
imported>Deantwo
(Just changed the headlines. I am done now I promise!)
(Restructured documentation a bit and added details)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{contents|}}}| {{Storage|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}|foundin={{{foundin}}}|usedfor={{{usedfor}}}|strategy={{{strategy}}}|description={{{description}}}|contents={{{contents}}}}} | {{#if:{{{description|}}}| {{ItemMedium|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}|foundin={{{foundin}}}|usedfor={{{usedfor}}}|strategy={{{strategy}}}|description={{{description}}}}} | {{#if:{{{name|}}}| {{Template:ItemSimple|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}}} | <font color='red'>'''The item needs to have the name defined.'''</font> }} }} }}</includeonly><noinclude>
<includeonly>{{#if:{{{contents|}}}| {{Storage|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}|foundin={{{foundin}}}|usedfor={{{usedfor}}}|strategy={{{strategy}}}|description={{{description}}}|contents={{{contents}}}}} | {{#if:{{{strategy|}}}| {{ItemMedium|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}|foundin={{{foundin}}}|usedfor={{{usedfor}}}|strategy={{{strategy}}}|description={{{description}}}}} | {{#if:{{{usedfor|}}}| {{ItemUsedFor|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}|foundin={{{foundin}}}|usedfor={{{usedfor}}}|description={{{description}}}}} | {{#if:{{{name|}}}| {{Template:ItemSimple|name={{{name}}}|image={{{image}}}|OverrideImage={{{OverrideImage|}}}|bgcolor1={{{bgcolor1}}}|bgcolor2={{{bgcolor2}}}}} | <font color='red'>'''The item needs to have the name defined.'''</font> }} }} }} }}</includeonly><noinclude>
= About =
Template intended for lists of objects to clean them up a bit. See [[General items]] for examples.


= How to use =
= Parameter-Usage =
 
{| class="wikitable"
template intended for lists of objects to clean them up a bit.
!Parameter
!Default
!Description
|-
!bgcolor1
|#cccccc
|Background-color 1
|-
!bgcolor2
|#bbbbbb
|Background-color 2
|-
!OverrideImage
|
|When set, the image parameter is directly inserted like <code><nowiki>[[File:Unknown.png]]</nowiki></code>. By default the image-paramter is used as an image-name like <code>Unknown.png</code>.
|-
!image
|Unknown.png
|Name of the item's image. See OverrideImage-parameter for alternative usage.
|-
!name
|Item
|Name of the item. If missing a warning will be displayed instead ('''The item needs to have the name defined.''')
|-
!foundin
|Undefined
|Short information on where to find the item
|-
!usedfor
|Undefined
|Short information on the item's purpose
|-
!strategy
|Undefined
|A short description of the usage context
|-
!description
|No description
|A free description of the items, its properties and use-contexts.
|}


= Examples =
== With no parameters ==
== With no parameters ==


Line 31: Line 73:
== Normal item ==
== Normal item ==


If the description is set, this template will show.
If the description is set, this template will show:


   <nowiki>{{Item</nowiki>
   <nowiki>{{Item</nowiki>
Line 59: Line 101:
}}
}}


==Strategy-less items==
If there is no strategy variable but there are foundin and used for, this template will show:
  <nowiki>{{Item</nowiki>
  <nowiki>|bgcolor1 = #FFEE88</nowiki>
  <nowiki>|bgcolor2 = #FFDD66</nowiki>
  <nowiki>|name = Emergency Toolbox</nowiki>
  <nowiki>|image = Redtoolbox.png</nowiki>
  <nowiki>|foundin = emergency lockers and storage areas</nowiki>
  <nowiki>|usedfor = Contains tools which are useful in emergencies</nowiki>
  <nowiki>|description = The toolbox contains a flashlight, a crowbar, a radio and a fire extinguisher. All of which are very useful not only when emergencies hit but also when trying to cause an emergency.</nowiki>
 
  <nowiki>Be quick in getting one as they tend to get looted quickly if you want until an emergency strikes.</nowiki>
  <nowiki>}}</nowiki>
{{Item
|name=Test Item
|bgcolor1 = #FFEE88
|bgcolor2 = #FFDD66
|image = Redtoolbox.png
|foundin = emergency lockers and storage areas
|usedfor = Contains tools which are useful in emergencies
|description = The toolbox contains a flashlight, a crowbar, a radio and a fire extinguisher. All of which are very useful not only when emergencies hit but also when trying to cause an emergency.<br><br>Be quick in getting one as they tend to get looted quickly if you want until an emergency strikes.
}}
== Container items ==
== Container items ==


If the contents variable is set, this template will thow:
If the contents variable is set, this template will show:


   <nowiki>{{Item</nowiki>
   <nowiki>{{Item</nowiki>
Line 93: Line 160:


==Override Image==
==Override Image==
If an image is bigger than 50px they will <s>break</s> not break anymore, since this is a more awesome wiki, but they will look very small, as shown below.<br>
Setting "OverrideImage=true" will disable the default image code so you can add your own.<br>
The default image code is:<br>
<nowiki>[[File:{{{image|{{{name|Unknown}}}.png}}}|px50|{{{name|Item}}}]]</nowiki>


If an image is bigger than 50px they will break, setting "OverrideImage=true" will disable the default image code so you can add your own.
For better understanding see these two examples:
See these two examples:


'''Without setting "OverrideImage":'''
'''Without setting "OverrideImage":'''
Line 104: Line 174:
  <nowiki>|image = ParticleAccelerator.gif</nowiki>
  <nowiki>|image = ParticleAccelerator.gif</nowiki>
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>
{{Item
{{Item
|bgcolor1 = #cce6ff
|bgcolor1 = #cce6ff
Line 119: Line 188:
  <nowiki>|bgcolor2 = #99ccff</nowiki>
  <nowiki>|bgcolor2 = #99ccff</nowiki>
  <nowiki>|name = Particle Accelerator</nowiki>
  <nowiki>|name = Particle Accelerator</nowiki>
  <nowiki>|image = [[File:ParticleAccelerator.gif]]</nowiki>
  <nowiki>|image = [[File:ParticleAccelerator.gif|Particle Accelerator]]</nowiki>
  <nowiki>|OverrideImage = true</nowiki>
  <nowiki>|OverrideImage = true</nowiki>
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>
{{Item
{{Item
|bgcolor1 = #cce6ff
|bgcolor1 = #cce6ff
|bgcolor2 = #99ccff
|bgcolor2 = #99ccff
|name = Particle Accelerator
|name = Particle Accelerator
|image = [[File:ParticleAccelerator.gif]]
|image = [[File:ParticleAccelerator.gif|Particle Accelerator]]
|OverrideImage = true
|OverrideImage = true
}}
}}


</noinclude>
</noinclude>
1,133

edits