Difference between revisions of "Template:Articleimage"

From Twinsuniverse
Jump to: navigation, search
m (Parameters)
m
Line 14: Line 14:
 
# 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, when hovering the image (no parameter name but text is case sensitive, defaults to "Image of <nowiki>{{PAGENAME}}</nowiki>")
 
# The text to show in the tooltip, when hovering the image (no parameter name but text is case sensitive, defaults to "Image of <nowiki>{{PAGENAME}}</nowiki>")
* '''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 any invalid image (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.''
 
'''''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.''
Line 28: Line 29:
  
  
When a nonexisting file is specified, this is what would happen:
+
When a nonexisting file is specified, the [[:Category:Articles with a missing image|Articles with a missing image]] maintenanance task is raised:
 
  <nowiki>{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}</nowiki>
 
  <nowiki>{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}</nowiki>
  
Line 34: Line 35:
  
  
When no file is specified at all (empty or left out), this is what would happen:
+
When no file is specified at all (empty or left out), the [[:Category:Articles without an image|Articles without an image]] maintenance task is raised:
 
  <nowiki>{{articleimage|This is an image for article: {{PAGENAME}}}}</nowiki>
 
  <nowiki>{{articleimage|This is an image for article: {{PAGENAME}}}}</nowiki>
  
Line 41: Line 42:
  
 
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: {{PAGENAME}}|nocat=true}}</nowiki>
+
  <nowiki>{{articleimage|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]]. This feature works on both maintenance tasks mentioned above.
  
 
[[Category:Article Categorizers]]
 
[[Category:Article Categorizers]]
 
</noinclude>
 
</noinclude>

Revision as of 21:23, 24 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

  1. The filename of an image from Category:Images or a subcategory (no parameter name but filename is case sensitive, defaults to an empty image)
  2. 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 any invalid image (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}}}}
This is an image for: Articleimage
(hover the image to see the tooltip)


When a nonexisting file is specified, the Articles with a missing image maintenanance task is raised:

{{articleimage|My Article Image.png|This is an image for article: {{PAGENAME}}}}
The image "My Article Image.png" is missing or has no description page
(hover the image to see the tooltip)


When no file is specified at all (empty or left out), the Articles without an image maintenance task is raised:

{{articleimage|This is an image for article: {{PAGENAME}}}}
No image was specified for this article
(hover the image to see the tooltip)


The nocat parameter may be used to suppress automatic categorization like this (any value will do):

{{articleimage|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. This feature works on both maintenance tasks mentioned above.