Difference between revisions of "Template:Item Image"

*>Karuberu
m
m (7 revisions imported)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{#switch:{{lc:{{{1|}}}}}|stub| = <includeonly>{{image-stub}}</includeonly>|[[File:{{{1|}}}|{{{2|{{PAGENAME}}}}}]]}}<noinclude>
+
<includeonly>{{#switch:{{lc:{{{1|}}}}}|stub| = {{#ifexist:File:{{PAGENAME}}.png|[[File:{{PAGENAME}}.png|{{PAGENAME}}]]|<table cellpadding="5" cellspacing="0" style="background-color: transparent;"><tr><td>[[File:Camera icon.gif|30px|]]</td><td>''This article is missing a picture of the item it covers. You can help by [[File:{{PAGENAME}}.png|adding it]].''</td></tr></table>
 +
{{#ifeq:{{NAMESPACE}}||[[Category:Image Stub]]}}}}|[[File:{{{1|}}}|{{{2|{{PAGENAME}}}}}]]}}</includeonly><noinclude>
 +
[[Category:Templates]]
 
==Usage==
 
==Usage==
 
<pre>
 
<pre>
 
{{Item Image|<image name>|<hovertext>}}
 
{{Item Image|<image name>|<hovertext>}}
 
</pre>
 
</pre>
*'''image name:''' The name of the image, such as "Dagger.png". If left blank, {{tl|image-stub}} will display instead.
+
*'''image name:''' The name of the image, such as "Dagger.png". If left blank, a message asking for the image will display instead.
 
*'''hovertext:''' (optional) The text to display when the mouse is hovered over the image. If left blank, the page's name will display.
 
*'''hovertext:''' (optional) The text to display when the mouse is hovered over the image. If left blank, the page's name will display.
 
===Examples===
 
===Examples===
Line 16: Line 18:
 
| <pre>{{Item Image|Silent_Oil.png|Pot of silent oil}}</pre>
 
| <pre>{{Item Image|Silent_Oil.png|Pot of silent oil}}</pre>
 
| {{Item Image|Silent_Oil.png|Pot of silent oil}}
 
| {{Item Image|Silent_Oil.png|Pot of silent oil}}
 +
|-
 +
| <pre>{{Item Image|}}</pre>
 +
| {{Item Image|}}
 
|}
 
|}
 
</noinclude>
 
</noinclude>

Latest revision as of 03:52, 13 July 2017

Usage[edit]

{{Item Image|<image name>|<hovertext>}}
  • image name: The name of the image, such as "Dagger.png". If left blank, a message asking for the image will display instead.
  • hovertext: (optional) The text to display when the mouse is hovered over the image. If left blank, the page's name will display.

Examples[edit]

Code Result
{{Item Image|Dagger.PNG}}
Dagger
{{Item Image|Silent_Oil.png|Pot of silent oil}}
Pot of silent oil
{{Item Image|}}
Camera icon.gifThis article is missing a picture of the item it covers. You can help by adding it.