Difference between revisions of "Template:Articleimage"
From Twinsuniverse
J McKalling (Talk | contribs) |
J McKalling (Talk | contribs) m |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
{{#ifexist: File:{{{1|doesnot}}} | {{#ifexist: File:{{{1|doesnot}}} | ||
− | | [[Image:{{{1|Divers.gif}}}|200px|thumb|{{{2|Image of | + | | [[Image:{{{1|Divers.gif}}}|200px|thumb|{{{2|Image of {{PAGENAME}}}}}]] |
− | | [[Image:Divers.gif|The image {{{1|-no filename-}}} is missing or has no description page]] {{ | + | | [[Image:Divers.gif|The image '{{{1|-no filename-}}}' is missing or has no description page]] {{ |
#ifeq: {{{nocat|false}}} | false | [[Category:Articles without an image]]}} | #ifeq: {{{nocat|false}}} | false | [[Category:Articles without an image]]}} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Line 9: | Line 9: | ||
==Parameters== | ==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 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 | + | # The text to show in the tooltip, when hovering the image (no parameter name but text is case sensitive, defaults to "Image of {{PAGENAME}}") |
* '''nocat''': Whether or not to suppress categorization in case of a nonexisting file (defaults to false, which means auto categorization). | * '''nocat''': Whether or not to suppress categorization in case of a nonexisting file (defaults to false, which means auto categorization). | ||
Line 19: | Line 19: | ||
==Examples== | ==Examples== | ||
Common use of the articleimage include both the filename and text parameters: | Common use of the articleimage include both the filename and text parameters: | ||
− | <nowiki>{{articleimage|Twinsen.jpg|This is an image for:}}</nowiki> | + | <nowiki>{{articleimage|Twinsen.jpg|This is an image for: {{PAGENAME}}}}</nowiki> |
:[[Image:Twinsen.jpg|This is an image for: {{PAGENAME}}]] | :[[Image:Twinsen.jpg|This is an image for: {{PAGENAME}}]] | ||
Line 25: | Line 25: | ||
When a nonexisting file is specified, this is what would happen: | When a nonexisting file is specified, this is what would happen: | ||
− | <nowiki>{{articleimage|My Article Image.png|This is an image for article:}}</nowiki> | + | <nowiki>{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}</nowiki> |
− | :[[Image:Divers.gif| | + | :[[Image:Divers.gif|The image 'My Article Image.png' is missing or has no description page]] |
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do): | The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do): | ||
− | <nowiki>{{articleimage|My Article Image.png|This is an image for article:|nocat=true}}</nowiki> | + | <nowiki>{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}|nocat=true}}</nowiki> |
(this would render the same result as the error example above, but would not categorize under [[:Category:Articles without an image]]) | (this would render the same result as the error example above, but would not categorize under [[:Category:Articles without an image]]) |
Revision as of 11:08, 15 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, when hovering the image (no parameter name but text is case sensitive, defaults to "Image of Articleimage")
- nocat: Whether or not to suppress categorization in case of a nonexisting file (defaults to false, which means auto categorization).
Note: Both filenames of nonexisting files and of files that don't have a description page yet, will result in the default image to be displayed instead.
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: {{PAGENAME}}}}
When a nonexisting file is specified, this is what would happen:
{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}
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: {{PAGENAME}}|nocat=true}}
(this would render the same result as the error example above, but would not categorize under Category:Articles without an image)