Template:Tile

From Predecessor Wiki
Jump to navigation Jump to search
Template-info.svg Documentation
Lua.svg
This template uses Module:Tile (edit | hist), a script written in Lua.

Creates a tile with an image and caption that is resizable. Intended as a replacement for galleries with improved custom sizing and style.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Image1 image

no description

Example
{{Tile|Countess.png}} or {{Tile|image=Countess.png}}
Filerequired
Caption2 caption

Text to accompany the image. Don't place any links inside this field.

Example
{{Tile|Countess.png|Countess}} or {{Tile|Countess.png|caption=Countess}}
Stringsuggested
Link3 link

The name of the page that the image and caption should link to.

Example
{{Tile|Countess.png|Countess|Countess}} or {{Tile|Countess.png|Countess|link=Countess}}
Page nameoptional
Width4 width w

The width of the tile's image (in pixels).

Default
100
Example
{{Tile|Countess.png|Countess||30}} or {{Tile|Countess.png|Countess|w=30}}
Numberoptional
Height5 height h

The height of the tile's image (in pixels).

Default
100
Example
{{Tile|Countess.png|Countess|||150}} or {{Tile|Countess.png|Countess|h=30}}
Numberoptional
Cropcrop

Determines the position of the image when cropped to fit into its specified size. Intended for when the image has been automatically cropped into an undesired position.

Suggested values
top bottom left right
Default
center
Example
{{Tile|Countess.png|Countess|crop=top}}
Stringoptional
Floatfloat

Used for positioning/aligning the tile on the page, allowing text to wrap around it.

Suggested values
left right
Default
none
Example
{{Tile|Countess.png|Countess|float=right}}
Stringoptional
CSScss

An additional parameter to add any CSS to customise the individual tile.

Example
{{Tile|Countess.png|Countess|css=font-size: 12px;}}
Stringoptional

Syntax

{{Tile|image|caption|link|width|height}}
{{Tile|image|caption|link|w=|h=}}
{{Tile|image=|caption=|link=|width=|height=}}

While all syntax's can be used, it's advised to use a combination of the the three, such as:

{{Tile|image|caption|link=|w=|h=}}

This is the most similar to a regular image syntax: [[Image:Image.png|Caption here|link=Link here]]

The first of the three syntax's can cause confusion, for example, when you want to specify only the height of the tile but don't want to add a link or change the width, it must be written like this:

{{Tile|image|caption|||height}}

This version of the syntax relies on the parameter's position within the template to be parsed, so the first parameter is counted as the image, second as caption, third as link and so on. This means when you don't need to include one of the parameters but need one that is counted after it, you still need to include the pipe symbol (|) as if it was there, causing confusion of which parameter is which. That's why for any parameter that isn't the image or caption, you should use a combination. Named parameters (e.g. width=, image=) do not need to be in a certain position within the template, making it far easier to work with.

Examples

{{Tile|Countess.png|Countess|Countess}}
Countess.png
Countess

Centered Tiles

To create a collection of centered tiles, similar to a gallery, you can wrap the tile templates in the <center> tag.

<center>
{{Tile|Countess.png|Countess|Countess}}
{{Tile|Countess.png|Countess|Countess}}
{{Tile|Countess.png|Countess|Countess}}
{{Tile|Countess.png|Countess|Countess}}
</center>

Crop Position

If the automatic crop of a tile's image is in an undesired position, you can manually set its position through 4 values: top, bottom, left and right.

<center>
{{Tile|Countess.png|Center||50|150}}
{{Tile|Countess.png|Left||50|150|crop=left}}
{{Tile|Countess.png|Right||50|150|crop=right}}
{{Tile|Countess.png|Center||200|100}}
{{Tile|Countess.png|Bottom||200|100|crop=bottom}}
{{Tile|Countess.png|Top||200|100|crop=top}}
</center>
Countess.png
Center
Countess.png
Left
Countess.png
Right
Countess.png
Center
Countess.png
Bottom
Countess.png
Top

Float Alignment

Like a thumbnail image, you can align the tile to be on the left or right of the page. This will allow any text to wrap around the tile.

{{Tile|Countess.png|Countess|Countess|float=left}}
{{Tile|Countess.png|Countess|Countess|float=right}}
Countess.png
Countess
Countess.png
Countess