Modèle:Icon

De Terraria Wiki
Aller à : navigation, rechercher
Template-info.svg Documentation La documentation ci-dessous est transcluse de Modèle:Icon/doc. (modifier | historique)

This template can be used to display one or more platform icons.

Can currently display icons for Desktop, Console, Japan Console, Old-gen Console, Mobile, and 3DS.

Will also add others like Xbox, PS3, etc.

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 can use {{icon/desktop}} / {{icon/console}} / {{icon/japan}} / {{icon/old-gen}} / {{icon/mobile}} / {{icon/3ds}} directly. In addition, this also allows you to have full control over the icon size.

Usage

{{icon
|icon (can be multiple and duplicate) : desktop/dsk, console/cns, japan/jas, old-gen/oldgen/old, mobile/mbl, 3ds/3DS (case insensitive). The display order is in the input order.
|nl=y or nolink=y : optional, icons will not be linked
|small=y : optional, each icon will be smaller than normal
}}

The order of unnamed parameters is irrelevant.

All Valid Icons

Parameters are case insensitive. List only in lowercase.

parameter(s) icon
desktop, dsk Version Bureau
console, cns Version Console
japan, jpc, jas, jcs Version Console japonaise
old-gen console, old-gen, oldgen, old Version Console old-gen
mobile, mbl Version Mobile
3ds Version 3DS
xbox one, xboxone, xb1 Xbox One
xbox 360, xbox360, xb360 Xbox One
playstation, ps Playstation
playstation3, ps3 PS3
playstation4, ps4 PS4
psvita, psv, vita PSVita
switch Nintendo Switch
wiiu Wii U
android Android
ios Apple iOS
google play, googleplay, google Google Play
windows phone, winphone, wp Windows Phone
amazon, amz, aws Amazon
Template pages:

Example

code result expected
{{icon| desktop }} Version Bureau Version Bureau
{{icon| desktop | console }} Version BureauVersion Console Version BureauVersion Console
{{icon| console | desktop }} Version ConsoleVersion Bureau Version ConsoleVersion Bureau
{{icon| desktop || | console }}
(Blank parameters are irrelevant.)
Version BureauVersion Console Version BureauVersion Console
{{icon| dsk | 3ds | mbl | cns }} Version BureauVersion 3DSVersion MobileVersion Console Version BureauVersion 3DSVersion MobileVersion Console
{{icon| dsk | dsk | mbl }} Version BureauVersion BureauVersion Mobile Version BureauVersion BureauVersion Mobile
{{icon| oldgen | mobile | nl=y | small=y }} Version Console old-genVersion Mobile Version Console old-genVersion Mobile
{{icon| small=y | oldgen | nl=y | mobile }}
(Valid, but poor code readability, so not recommanded)
Version Console old-genVersion Mobile Version Console old-genVersion Mobile
All the icons:
{{icon| desktop | console | japan | oldgen | mobile | 3ds }} Version BureauVersion ConsoleVersion Console japonaiseVersion Console old-genVersion MobileVersion 3DS Version BureauVersion ConsoleVersion Console japonaiseVersion Console old-genVersion MobileVersion 3DS
{{icon| desktop | console | japan | oldgen | mobile | 3ds | small=y }} Version BureauVersion ConsoleVersion Console japonaiseVersion Console old-genVersion MobileVersion 3DS Version BureauVersion ConsoleVersion Console japonaiseVersion Console old-genVersion MobileVersion 3DS

How to Add New Icon Types

Only need to create a corresponding Template:icon/[icontype] (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: Template name must use lowercase(e.g. Template:icon/ios, not Template:icon/IOS or Template:icon/Ios). That's all. Now we can use {{icon|ios}} to display a 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.