Difference between revisions of "Template:Item Image"

*>Karuberu
m (7 revisions imported)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{lc:{{{1|}}}}}|stub| = <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 <includeonly>[[File:{{PAGENAME}}.png|adding it]].''</td></tr></table>
+
<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}}|Template||[[Category:Image Stub]]}}|[[File:{{{1|}}}|{{{2|{{PAGENAME}}}}}]]}}</includeonly><noinclude>
+
{{#ifeq:{{NAMESPACE}}||[[Category:Image Stub]]}}}}|[[File:{{{1|}}}|{{{2|{{PAGENAME}}}}}]]}}</includeonly><noinclude>
 +
[[Category:Templates]]
 
==Usage==
 
==Usage==
 
<pre>
 
<pre>

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.