Template:Float file box

From Terraria Wiki
Jump to navigation Jump to search
Template-info.svg Documentation The documentation below is transcluded from Template:Float file box/doc. (edit | history)

This is an alternative version of {{float file}}. It is similarly used to display an image to the left of an infobox, but it additionally accommodates placing long captions on small images (small images usually cause long captions to cut off and/or break into many unsightly lines). It also accommodates multiple images with captions.

Please use the standard image thumbnail mode if possible ([[File:Terraria.png|thumb|Image caption.]]). This template should only be used for particularly narrow images or a more complex image arrangement.

Usage

{{ float file box | <image 1 wiki code> | <image 1 caption> | <image 2 wiki code> | <image 2 caption> | ... | title = <box title> | title3/5/... = <sub-title above image 2/3/...> | float = right/left/none | width = <box width> | class = <custom CSS class> | css/style = <custom box styling> }}

First, third, fifth, etc. unnamed parameter

Complete wiki code for an image, including brackets. Can be continued nearly infinitely.

Second, fourth, sixth, etc. unnamed parameter

Text of the caption beneath the image. Can be continued nearly infinitely.

title

Text displayed as the title of the box.

title3, title5, etc.

Title within the box above the corresponding unnamed parameter. For example, $title3 will be displayed above the contents of the third unnamed parameter, i.e. the second image.

float

Float position, defaults to right.

width

Width of the box, defaults to 150px. Make sure that the box is at least as wide as the widest image in it plus 20px; otherwise the image will jut out.

class

Additional CSS class for the entire box.

css/style

Additional styling for the entire box.

Examples

Code Result
{{float file box
|[[File:Dye test on Orichalcum armor (Pink Dye).png]]
|This very long caption would normally look ''very awkward'' underneath this narrow image of [[Orichalcum armor]] being dyed with [[Pink Dye]].
}}
Dye test on Orichalcum armor (Pink Dye).png
This very long caption would normally look very awkward underneath this narrow image of Orichalcum armor being dyed with Pink Dye.
{{float file box
|width=96px
|class=note-text
|css=border-width:3px;font-style:italic;
|title=CSS demo
|[[File:Tree.png]]|This is an image of a tree.
|[[File:Flower vines.png]]|<!-- no caption -->
|[[File:Growing cactus.png]]|This is an image of a cactus.
|title7=Stone Block!
|[[File:Stone Block.png]]
}}
CSS demo
Tree.png
This is an image of a tree.
Flower vines.png
Growing cactus.png
This is an image of a cactus.
Stone Block!
Stone Block.png
{{float file box
|title=Portal sprites
|{{inline block|css=width:50%;line-height:2.5|[[File:Return Portal Entrance.gif]]<br/>Entrance}}{{inline block|css=width:50%;line-height:2.5|[[File:Return Portal Exit.gif]]<br/>Exit}}
|title2=Minimap icons
|{{inline block|css=width:50%;line-height:2.5|[[File:Map Return Portal Entrance.png]]<br/>Entrance}}{{inline block|css=width:50%;line-height:2.5|[[File:Map Return Portal Exit.png]]<br/>Exit}}
}}
Portal sprites
Return Portal Entrance.gif
Entrance
Return Portal Exit.gif
Exit
Minimap icons
Map Return Portal Entrance.png
Entrance
Map Return Portal Exit.png
Exit
{{float file box
|width=180px
|<div style{{=}}"text-align:left;line-height:3.5">[[File:Stardust Dragon minion (1 summon).png|link=]]<br/>[[File:Stardust Dragon minion (2 summons).png|link=]]</div>
|Stardust Dragon minion summoned 1 time (top) and 2 times (bottom).
}}
Stardust Dragon minion (1 summon).png
Stardust Dragon minion (2 summons).png
Stardust Dragon minion summoned 1 time (top) and 2 times (bottom).
{{float file box|width=220px|title=Comparison of block blending|<!--
-->{{inline block|style=vertical-align:top; line-height:unset; max-width:90px; margin-right:10px|[[File:Stone Slab block merging.png]]<br/>Stone Slabs}}<!--
-->{{inline block|style=vertical-align:top; line-height:unset; max-width:90px|[[File:Stone Accent Slab block merging.png]]<br/>Stone Accent Slabs}}
}}
Comparison of block blending
Stone Slab block merging.png
Stone Slabs
Stone Accent Slab block merging.png
Stone Accent Slabs
{{float file box|width=200px
|{{item|mode=image|White Present Slime}} {{item|mode=image|Yellow Present Slime}} {{item|mode=image|Green Present Slime}} {{item|mode=image|Red Present Slime}}
|Present Slimes appearing during [[Christmas]]
|title3=<nowiki/>
|{{item|mode=image|Bunny Slime}}
|Slime in [[Bunny]] costume for [[Halloween]]
}}
White Present Slime Yellow Present Slime Green Present Slime Red Present Slime
Present Slimes appearing during Christmas
Bunny Slime
Slime in Bunny costume for Halloween

{{options/set|item|mode=image|nolink=y}}

{{float file box|width=180px
|title=Slab walls
|{{flexbox|style=gap:4px; margin-bottom:-6px|justify=justified|wrap=no<!--
	-->|{{item|size=50px|Blue Slab Wall|image=Blue Slab Wall (placed).png}}<!--
	-->|{{item|size=50px|Green Slab Wall|image=Green Slab Wall (placed).png}}<!--
	-->|{{item|size=50px|Pink Slab Wall|image=Pink Slab Wall (placed).png}}}}
|
|title3=<nowiki/>
|{{flexstart|style=gap:1.5em|wrap=no|alignitems=center}}<!--
	-->{{flexstart|item|style=text-align:left}}Faction flags<br/>in this area:{{flexend|item}}<!--
	-->{{flexstart|item|shrink=0}}<!--
		-->{{item|Rusted Company Standard|image=Rusted Company Standard (placed).png}} <!--
		-->{{item|Ragged Brotherhood Sigil|image=Ragged Brotherhood Sigil (placed).png}}<!--
	-->{{flexend|item}}<!--
-->{{flexend}}
}}

{{options/reset|item}}

Slab walls
Blue Slab WallGreen Slab WallPink Slab Wall
Faction flags
in this area:
Rusted Company StandardRagged Brotherhood Sigil