Difference between revisions of "Template:Articleimage"
From Twinsuniverse
J McKalling (Talk | contribs) (Created page with "<includeonly>{{ #ifexists: {{{1|Divers.gif}}} | [[Image:{{{1|Divers.gif}}}|{{{2|Image of}}} {{PAGENAME}}]] | Image of}}} {{PAGENAME}} (missing) {{ ...") |
J McKalling (Talk | contribs) m |
||
Line 1: | Line 1: | ||
− | <includeonly>{{ | + | <includeonly> |
− | #ifexists: {{{1|Divers.gif}}} | + | {{#ifexists: {{{1|Divers.gif}}} |
| [[Image:{{{1|Divers.gif}}}|{{{2|Image of}}} {{PAGENAME}}]] | | [[Image:{{{1|Divers.gif}}}|{{{2|Image of}}} {{PAGENAME}}]] | ||
| [[Image:Divers.gif|{{{2|Image of}}} {{PAGENAME}} (missing)]] {{ | | [[Image:Divers.gif|{{{2|Image of}}} {{PAGENAME}} (missing)]] {{ |
Revision as of 22:15, 13 November 2012
This template makes it easier to add an image to an article, that automatically displays a default image when incorrect.
Parameters
- The filename of an image from Category:Images or a subcategory (no parameter name but filename is case sensitive, defaults to an empty image)
- The text to show in the tooltip before the page name, when hovering the image (no parameter name but text is case sensitive, defaults to "Image of")
- nocat: Whether or not to suppress categorization in case of a nonexisting file (defaults to false, which means auto categorization).
Syntax
{{articleimage|filename|text}}
Examples
Common use of the articleimage include both the filename and text parameters:
{{articleimage|Twinsen.jpg|This is an image for article:}}
When a nonexisting file is specified, this is what would happen:
{{articleimage|My Article Image.png|This is an image for article:}}
The nocat parameter may be used to suppress automatic categorization like this (any value will do):
{{articleimage|My Article Image.png|This is an image for article:|nocat=true}}
(this would render the same result as the error example above, but would not categorize under Category:Articles without an image)