Template:Tile: Difference between revisions

From Red Faction Wiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>{| class="tile"
<includeonly>{| class="tile"
|style="width:{{{4|128}}}px; height:{{{5|128}}}px;"|{{#if: {{{3|}}} | [[Image:{{{1}}}|link={{{3}}}]]| [[Image:{{{1}}}]]}}
|style="width:{{{4|128}}}px; height:{{{5|128}}}px;"| [[Image:{{{1}}}<!--
-->{{#if: {{{3|}}}|{{!}}link={{{3}}} }}<!--
-->{{#if: {{{crop|}}}|{{!}}class=img-{{{crop}}} }}]]
|-
|-
|{{#if: {{{2|}}}  
|{{#if: {{{2|}}}  
Line 6: Line 8:
   | ''' '''
   | ''' '''
}}
}}
|}</includeonly>
|}</includeonly><noinclude>
<noinclude><templatedata>
<templatedata>
{
{
"params": {
"params": {
Line 42: Line 44:
"type": "number",
"type": "number",
"default": "128"
"default": "128"
},
"crop": {
"label": "Crop",
"description": "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.",
"example": "top",
"type": "string",
"suggestedvalues": [
"top",
"bottom",
"left",
"right"
],
"default": "center"
}
}
},
},
Line 49: Line 64:
"3",
"3",
"4",
"4",
"5"
"5",
"crop"
],
],
"description": "Creates a tile with an image and caption that is resizable. Intended as a replacement for galleries with improved custom sizing and style.",
"description": "Creates a tile with an image and caption that is resizable. Intended as a replacement for galleries with improved custom sizing and style.",
Line 58: Line 74:
'''Usage:'''
'''Usage:'''
<pre>{{Tile|Min_ATV.png|Mining ATV||250|150}}</pre>
<pre>{{Tile|Min_ATV.png|Mining ATV||250|150}}</pre>
'''Output:'''
'''Output:'''
{{Tile|Min_ATV.png|Mining ATV||250|150}}
{{Tile|Min_ATV.png|Mining ATV||250|150}}
<br><br>
<br><br>
'''Centered Tiles:'''
'''Centered Tiles:'''


To create a collection of centered tiles, similar to a gallery, you can wrap the tile templates in the <nowiki><center></nowiki> tag.
To create a collection of centered tiles, similar to a gallery, you can wrap the tile templates in the <nowiki><center></nowiki> tag.
 
'''Usage:'''<pre><center>
'''Usage:'''
<pre><center>
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
Line 81: Line 93:
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
</center>
<br><br>
'''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''.
'''Usage:'''
<pre><center>
{{Tile|Min_ATV.png|Center||50|150}}
{{Tile|Min_ATV.png|Left||50|150|crop=left}}
{{Tile|Min_ATV.png|Right||50|150|crop=right}}
{{Tile|Min_ATV.png|Center||200|100}}
{{Tile|Min_ATV.png|Bottom||200|100|crop=bottom}}
{{Tile|Min_ATV.png|Top||200|100|crop=top}}
</center>
</pre>
'''Output:'''
<center>
{{Tile|Min_ATV.png|Center||50|150}}
{{Tile|Min_ATV.png|Left||50|150|crop=left}}
{{Tile|Min_ATV.png|Right||50|150|crop=right}}
{{Tile|Min_ATV.png|Center||200|100}}
{{Tile|Min_ATV.png|Bottom||200|100|crop=bottom}}
{{Tile|Min_ATV.png|Top||200|100|crop=top}}
</center>
</center>
</noinclude>
</noinclude>

Revision as of 14:17, 30 January 2024

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

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Image1

no description

Example
Icon_RFG.png
Filerequired
Caption2

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

Example
Alec Mason
Stringsuggested
Link3

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

Example
Red Faction: Guerrilla
Page nameoptional
Width4

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

Default
128
Example
50
Numberoptional
Height5

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

Default
128
Example
150
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
top
Stringoptional
{{Tile|IMAGE|CAPTION|LINK|WIDTH|HEIGHT}}

Usage:

{{Tile|Min_ATV.png|Mining ATV||250|150}}

Output:

Min ATV.png
Mining ATV



Centered Tiles:

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

Usage:

<center>
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
{{Tile|Min_ATV.png|Mining ATV||150|100}}
</center>

Output:

Min ATV.png
Mining ATV
Min ATV.png
Mining ATV
Min ATV.png
Mining ATV
Min ATV.png
Mining ATV



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. Usage:

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

Output:

Min ATV.png
Center
Min ATV.png
Left
Min ATV.png
Right
Min ATV.png
Center
Min ATV.png
Bottom
Min ATV.png
Top