模板:Icon/doc
This template can be used to display one or more platform icons.
Note: If you only want to display a single platform icon, say, desktop, you can use {{icon|desktop}}
, of course; but if in a performance-sensitive context (such as used in other templates), you should use {{icon/desktop}}
(see here for all individual icon templates) directly. In addition, this also allows you to have full control over the icon size.
If the purpose of the icon is to show exclusivity of a certain entity or mechanic, {{eicons}} may be better to use instead.
Usage
{{ icon | <platform 1> | <platform 2> | ... | <platform n> | nl = y (optional) | small = y (optional) }}
- Unnamed parameters
See below for the list of possible values. The possible number of unnamed parameters is nearly infinite; their order is irrelevant.
- nl or nolink
Removes the link from the icons. They are linked by default.
- small
Reduces the icons' size to 75%.
參數 | 描述 | 類型 | 狀態 | |
---|---|---|---|---|
Platform | 1 | Name of the platform | 單行文本 | 必填 |
Platform 2 | 2 | Name of an additional platform. | 單行文本 | 可選 |
Platform 3 | 3 | Name of an additional platform. | 單行文本 | 可選 |
Platform 4 | 4 | Name of an additional platform. | 單行文本 | 可選 |
Platform 5 | 5 | Name of an additional platform. Repeat this as many times as necessary. | 單行文本 | 可選 |
Unlink icons | nl nolink | Remove the link from the icons.
| 布爾值 | 可選 |
Reduce icon size | small | Reduces the icons' size to 75%.
| 布爾值 | 可選 |
此模板首選參數行內格式。
All valid icons
Values are listed in lowercase here, but are functionally case-insensitive.
Value | Icon |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
How to add new icon types
Only need to create a corresponding Template:Icon/<icon name>
(its content can refer to {{icon/desktop}}). If you need to allow multiple valid parameters for it, use redirection.
For example, say, want to add a new iOS icon type:
- Create
Template:Icon/ios
(similar to {{icon/desktop}}). Note: The template name must use lowercase (i.e. notTemplate:icon/iOS
,Template:Icon/IOS
orTemplate:Icon/Ios
). That's all. Now we can use{{icon|ios}}
to display an iOS icon. - If you want to add a new alias parameter for it, for example, you want to allow display a iOS icon by using
{{icon|iphone}}
, just create a redirect pageTemplate:Icon/iphone
, and set its redirect target toTemplate:Icon/ios
.