Difference between revisions of "Template:PropVals/getIcon/doc"

From Salem Wiki
Jump to: navigation, search
(Initial setup)
 
m (→‎Description: update with detailed working)
Line 4: Line 4:
 
:If no icon can be found or it doesn't exist, then [[Image:Unknown Item icon.png]] will be displayed.
 
:If no icon can be found or it doesn't exist, then [[Image:Unknown Item icon.png]] will be displayed.
 
:If [[Image:Unknown Item icon.png]] is displayed, then the image will link to the image that '''should have been shown''', to easy uploading one by clicking the image.
 
:If [[Image:Unknown Item icon.png]] is displayed, then the image will link to the image that '''should have been shown''', to easy uploading one by clicking the image.
 +
:It uses {{t|HasProp|Has icon}}, on the requested page and use the value 'Has icon' as icon-image to display.
 +
:If it can't find that property then it will auto-compose a filename for the icon-image to use:
 +
::The composed filename of the icon-image is composed of the last part of the pagename followed by "_icon.png".
  
 
==Syntax==
 
==Syntax==

Revision as of 23:45, 6 July 2012

Description

This template is used to automatically display an icon for a page.
The page to fetch an icon for is given as its only argument.
If no icon can be found or it doesn't exist, then Unknown Item icon.png will be displayed.
If Unknown Item icon.png is displayed, then the image will link to the image that should have been shown, to easy uploading one by clicking the image.
It uses {{HasProp|Has icon}}, on the requested page and use the value 'Has icon' as icon-image to display.
If it can't find that property then it will auto-compose a filename for the icon-image to use:
The composed filename of the icon-image is composed of the last part of the pagename followed by "_icon.png".

Syntax

Type the below code somewhere on a page:
{{PropVals/getIcon|pagename}}
pagename will default to {{PAGENAME}} when not provided.

Examples

  1. {{PropVals/getIcon}} ⇒ No image found, click to upload
  2. {{PropVals/getIcon|Nails}} ⇒ Nails icon.png