Difference between revisions of "Template:Articleimage"
J McKalling (Talk | contribs) m |
J McKalling (Talk | contribs) m |
||
Line 9: | Line 9: | ||
#ifeq: {{{nocat|false}}} | false | [[Category:Articles with a missing image]]}}}} | #ifeq: {{{nocat|false}}} | false | [[Category:Articles with a missing image]]}}}} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
− | This template makes it easier to add an image to an article, that automatically displays a default image when incorrect. | + | This template makes it easier to add an image to an article, that automatically displays a default image when incorrect. This also automatically categorizes the article under [[:Category:Articles with a missing image]] when the specified image doesn't exist, or under [[:Category:Articles without an image]] when no image or an empty value was given. |
==Parameters== | ==Parameters== |
Revision as of 18:18, 22 November 2012
This template makes it easier to add an image to an article, that automatically displays a default image when incorrect. This also automatically categorizes the article under Category:Articles with a missing image when the specified image doesn't exist, or under Category:Articles without an image when no image or an empty value was given.
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}}}}
- (hover the image to see the tooltip)
When a nonexisting file is specified, this is what would happen:
{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}
- (hover the image to see the tooltip)
When no file is specified at all (empty or left out), this is what would happen:
{{articleimage|This is an image for article: {{PAGENAME}}}}
- (hover the image to see the tooltip)
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)