The Sims Medieval Wiki
m (→‎Usage: clean up categories)
m (→‎Usage: updated template)
Line 18: Line 18:
   
 
===Usage===
 
===Usage===
1. Use this template to define the object in its own page, for example, in a page Shield of Invisibility<pre>
+
1. Use this template to define the object in its own page
 
<pre>
{{Armor
 
  +
<includeonly><onlyinclude>{{Armor
 
| {{{1}}}
 
| {{{1}}}
  +
| name=
| name=Shield of Invisibility
 
  +
| desc=
| desc=No, this shield does not make you invisible. The shield IS invisible. In fact, you can't really know for sure whether it is there or not.
 
  +
| image=
| image=File:Shield_of_invisibility.png
 
| imagewidth=200
+
| imagewidth=
  +
| caption=
| caption=Caption for image
 
  +
| icon=
| icon=File:Shield_of_invisibility_icon.png
 
| defense=5
+
| defense=
| weight=5
+
| weight=
| bestdefense=6
+
| bestdefense=
| bestweight=4
+
| bestweight=
  +
| recipe=
| notes=This shield don't exists, in-game or otherwise.
 
  +
| notes=
}}
 
  +
}}</onlyinclude></includeonly><noinclude>
</pre>
 
  +
{{infobox item2|{{PAGENAME}}}}
  +
[[{{:{{PAGENAME}}|icon}}|left]]
  +
<blockquote>''"{{:{{PAGENAME}}|desc}}"''</blockquote>
   
  +
2. Use the following way to extract properties from the generated page.
 
  +
==Description==
<pre>
 
  +
{{:Shield of Invisibility|name}} is a {{:Shield of Invisibility|type}} (Defense:{{:Shield of Invisibility|defense}, Weight:{{:Shield of Invisibility|weight}})
 
  +
==Uses==
</pre>
 
  +
Output:
 
  +
==Sources==
<pre>
 
  +
Shield of Invisibility is a Armor(Defense:5, Weight:5)
 
  +
==Also See==
  +
  +
  +
{{Equipment}}
  +
</noinclude>
 
</pre>
 
</pre>
  +
 
2. Use the syntax <nowiki>{{:PAGENAME|<property>}}</nowiki> to extract properties from the generated page.
  +
E.g.
  +
  +
===Expression===
  +
----
  +
<nowiki>{{:Doomplate|name}} is a {{:Doomplate|type}} (Defense:{{:Doomplate|defense}, Weight:{{:Doomplate|weight}})</nowiki>
  +
  +
----
 
===Output===
  +
  +
----
  +
 
{{:Doomplate|name}} is a {{:Doomplate|type}} (Defense:{{:Doomplate|defense}}, Weight:{{:Doomplate|weight}})
  +
----
   
 
{{Equipment}}
 
{{Equipment}}

Revision as of 20:02, 11 April 2011

This template generates a Armor object with queriable properties.

Usage

1. Use this template to define the object in its own page

<includeonly><onlyinclude>{{Armor
| {{{1}}}
|        name=
|        desc=
|       image=
|  imagewidth=
|     caption=
|        icon=
|     defense=
|      weight=
| bestdefense=
|  bestweight=
|      recipe=
|       notes=
}}</onlyinclude></includeonly><noinclude>
{{infobox item2|{{PAGENAME}}}}
[[{{:{{PAGENAME}}|icon}}|left]]
<blockquote>''"{{:{{PAGENAME}}|desc}}"''</blockquote>


==Description==

==Uses==

==Sources==

==Also See==


{{Equipment}}
</noinclude>

2. Use the syntax {{:PAGENAME|<property>}} to extract properties from the generated page. E.g.

Expression


{{:Doomplate|name}} is a {{:Doomplate|type}} (Defense:{{:Doomplate|defense}, Weight:{{:Doomplate|weight}})


Output


DoomplateTemplate loop detected: Template:Armor is a ArmorTemplate loop detected: Template:Armor (Defense:10Template loop detected: Template:Armor, Weight:5Template loop detected: Template:Armor)