Difference between revisions of "Template:PropVals/getIcon/doc"
From Salem Wiki
< Template:PropVals | getIcon
m (→Description: update with detailed working) |
m (Protected "Template:PropVals/getIcon/doc": Documentation of key-feature ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
:This template is used to automatically display an icon for a page. | :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. | :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 [[Image:Unknown Item icon.png]] will be | + | :If no icon can be found or it doesn't exist, then [[Image:Unknown Item icon.png]] will be displayed, and 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 in its [[Property:Has icon]] as icon-image to display. | |
− | :It uses {{t|HasProp|Has icon}}, on the requested page and use the value | ||
:If it can't find that property then it will auto-compose a filename for the icon-image to use: | :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". | ::The composed filename of the icon-image is composed of the last part of the pagename followed by "_icon.png". | ||
+ | ::fe. when an icon should be displayed for "somepage/subpage", then this icon would be "Image:subpage icon.png". | ||
==Syntax== | ==Syntax== |
Latest revision as of 18:16, 25 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 will be displayed, and 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 in its Property: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".
- fe. when an icon should be displayed for "somepage/subpage", then this icon would be "Image:subpage icon.png".
Syntax
- Type the below code somewhere on a page:
{{PropVals/getIcon|pagename}}
- pagename will default to
{{PAGENAME}}
when not provided.
Examples
- {{PropVals/getIcon}} ⇒
- {{PropVals/getIcon|Nails}} ⇒