Template:Item link 2-cell

来自Terraria Wiki
(重定向自Template:Il2c
跳转至: 导航搜索
Template-info.svg 文档 以下文档内容来自模板:Item link 2-cell/doc。 (edit | history)

This template is similar to the {{item link}} template, but is meant for use in tables where the item image and item name are to be placed in separate, horizontally adjacent table cells. This allows all item names to align with each other, images will be centered (but can be aligned as well with the istyle parameter).

Usage[编辑源代码]

Use the shortcut {{il2c}} for convenience:

{{il2c|<item name>|size=}}

This displays a centered image link for the item in one cell, and a text link in the next. No CSS may precede the template, because CSS style is used within the template to center the image. All additional styling must be sent to the template via lstyle, istyle, and tstyle.

unnamed parameter 1
Item name.
tstyle, unnamed parameter 2
Optional parameter to set the CSS style of the cell containing the item name.
istyle
Optional parameter to set the CSS style of the cell containing the item image.
lstyle
Optional parameter to set the CSS style of both cells (item image and item name).
attr
Optional parameter to set cell attributes (e.g., rowspan).
A colon can be used between the attribute and its value, or {{=}}.
The default middle vertical alignment for rowspans greater than 1 can be changed with valign=top (attr=valign:top).
ext
Optional parameter to set the image file extension (e.g. gif); default is png.
size
Optional parameter to set the image width.
id
Optional parameter to display the item ID.
npcid
Optional parameter to display the NPC ID.
t
Optional parameter to set custom link text. This replaces the item name displayed, while keeping the link destination and image intact.
image
Optional parameter to set a custom image. This replaces the image displayed, while keeping the link destination and text intact. Enter as a naked image name with no [[File: code, eg. Paintbrush.png.
nl
Optional flag to no-link the item and image. User will be unable to click either the image or the item name. Any value may be sent to trigger the flag.
anchor
Optional flag to create an anchor.
icons
Optional flag to alter the display of icons, =no (disables), =br (breaks to next line), =small (smaller icons), br and small may be combined (see example below).


Example[编辑源代码]

Code:
{| class="wikitable"
 | {{il2c|Bed}}
 |-
 | {{il2c|Palm Wood Bed|nl=y}}
 |-
 | {{il2c|Wood|tstyle=font-style:italic; background-color:papayawhip}}
 |-
 | {{il2c|Zombie|size=20px}}
 |-
 | {{il2c|Iron Pickaxe|id=1|anchor=y|nl=y}}
 |-
 | {{il2c|Vilethorn|t=A Vilethorn}}
 |-
 | {{il2c|Beehive|image=Dislodgeable Beehive.png}}
 |-
 | {{il2c|Ruler|istyle=text-align:right|lstyle=border-bottom: 1px solid #00F;}}
 |-
 | {{il2c|Blue Flare|attr=rowspan:2}} || 5 seconds
 |-
 | 10 seconds
 |- valign=top
 | {{il2c|Blue Flare|attr=rowspan{{=}}2}} || 5 seconds
 |-
 | 10 seconds
 |-
 | {{il2c|Blue Flare|attr=rowspan:2 valign:top}} || 5 seconds
 |-
 | 10 seconds
 |-
 | {{il2c|image=Red Paint.png|t=Red Paint|Paint}}
 |-
 | {{il2c|image=Red Paint.png|t=Red Paint|Paint|icons=no}}
 |-
 | {{il2c|image=Red Paint.png|t=Red Paint|id=1073|Paint|icons=br-small}}
 |}
Produces:

Bed.png  
Palm Wood Bed.png 棕榈木床 
Wood.png 木材 
Zombie.png 僵尸 
Iron Pickaxe.png 铁镐 
内部物品 ID: 1
Vilethorn.png 魔刺 
Dislodgeable Beehive.png 马蜂窝 电脑版
Ruler.png 标尺 
Blue Flare.png 蓝照明弹  5 seconds
10 seconds
Blue Flare.png 蓝照明弹  5 seconds
10 seconds
Blue Flare.png 蓝照明弹  5 seconds
10 seconds
Red Paint.png 红漆 电脑版主机版移动版
Red Paint.png 红漆
Red Paint.png 红漆
电脑版主机版移动版
内部物品 ID: 1073
Promotional Content