模板:Icon

出自Terraria Wiki
跳至導覽 跳至搜尋
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Icon-version/l10n for the localization of this template.
Template-info.svg 文檔 以下文檔來自Template: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%.

參數描述類型狀態
Platform1
Name of the platform
單行文本
必填
Platform 22
Name of an additional platform.
單行文本
可選
Platform 33
Name of an additional platform.
單行文本
可選
Platform 44
Name of an additional platform.
單行文本
可選
Platform 55
Name of an additional platform. Repeat this as many times as necessary.
單行文本
可選
Unlink iconsnl
nolink
Remove the link from the icons.
自動值:
True (1/y/yes)
布爾值
可選
Reduce icon sizesmall
Reduces the icons' size to 75%.
自動值:
True (1/y/yes)
布爾值
可選

此模板首選參數行內格式。

All valid icons

Values are listed in lowercase here, but are functionally case-insensitive.

Value Icon
任天堂3DS版
Amazon Appstore
Android
主機版
電腦版
Google Play
iOS與iPadOS
日本主機版
Linux
macOS
移動版
前代主機版
PlayStation
PlayStation 3
PlayStation 4
PlayStation 5
PlayStation Vita
Stadia
任天堂Switch
tModLoader舊版本
Wii U
Windows
Windows Phone
Xbox
Xbox 360
Xbox One
Xbox Series X|S

Example

Code Result Expected result
{{icon| desktop }} 電腦版 電腦版
{{icon| desktop | console }} 電腦版主機版 電腦版主機版
{{icon| console | desktop }} 主機版電腦版 主機版電腦版
{{icon| desktop ||   | | console }}
(Blank parameters are irrelevant.)
電腦版主機版 電腦版主機版
{{icon| dsk | 3ds | mbl | cns }} 電腦版任天堂3DS版移動版主機版 電腦版任天堂3DS版移動版主機版
{{icon| dsk | dsk | mbl }} 電腦版電腦版移動版 電腦版電腦版移動版
{{icon| oldgen | mobile | nl=y | small=y }} 前代主機版移動版 前代主機版移動版
{{icon| small=y | oldgen | nl=y | mobile }}
(Valid, but poor code readability, so not recommended.)
前代主機版移動版 前代主機版移動版
All icons:
{{icon| desktop | console | japan | oldgen | mobile | 3ds }} 電腦版主機版日本主機版前代主機版移動版任天堂3DS版 電腦版主機版日本主機版前代主機版移動版任天堂3DS版
{{icon| desktop | console | japan | oldgen | mobile | 3ds | small=y }} 電腦版主機版日本主機版前代主機版移動版任天堂3DS版 電腦版主機版日本主機版前代主機版移動版任天堂3DS版

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:

  1. Create Template:Icon/ios (similar to {{icon/desktop}}). Note: The template name must use lowercase (i.e. not Template:icon/iOS, Template:Icon/IOS or Template:Icon/Ios). That's all. Now we can use {{icon|ios}} to display an iOS icon.
  2. 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 page Template:Icon/iphone, and set its redirect target to Template:Icon/ios.