Difference between revisions of "Template:MinimapIcon"

From Cassette Beasts
m (Fix the template for tables, the third)
(Refactor parameters list; Change default vertical alignment to middle)
 
Line 15: Line 15:
 
   | false = frameless
 
   | false = frameless
 
   | {{{frame}}}
 
   | {{{frame}}}
}} {{!}} {{{size|{{{2|16px}}}}}} {{!}} {{{halign|}}} {{!}} {{{valign|baseline}}} {{!}} link={{{link|}}} {{!}} alt={{{alt|{{{1}}}}}} {{!}} {{{title|{{{1}}}}}}]]</includeonly><noinclude>'''Note:''' A list of all available minimap icons can be found under [[:Category:Minimap Icons]]
+
}} {{!}} {{{size|{{{2|16px}}}}}} {{!}} {{{halign|}}} {{!}} {{{valign|}}} {{!}} link={{{link|}}} {{!}} alt={{{alt|{{{1}}}}}} {{!}} {{{title|{{{1}}}}}}]]</includeonly><noinclude>'''Note:''' A list of all available minimap icons can be found under [[:Category:Minimap Icons]]
  
== Positional Parameters ==
+
== Parameters ==
===== 1 =====
+
; 1<span class="anchor" id="1"></span>
 
: The minimap icon to show. Will be passed on to [[Template:MinimapIconFile]] as-is.
 
: The minimap icon to show. Will be passed on to [[Template:MinimapIconFile]] as-is.
 
+
; 2<span class="anchor" id="2"></span>
===== 2 =====
+
: ''(optional, defaults to 16px)''<br>The resizing option. Will only be used if the [[#size|<code>size</code> parameter]] is not used.
: ''(optional)'' The [https://www.mediawiki.org/wiki/Help:Images#Syntax resizing option]. Defaults to <code>16px</code> and will only be used if the [[#size|<code>size</code> parameter]] is not used.
+
: See [https://www.mediawiki.org/wiki/Help:Images#Syntax the MediaWiki help page] for details.
 
+
; border
== Named Parameters ==
+
: ''(optional, defaults to false)''<br>Whether to add a small grey border to the image. Use <code>y</code>, <code>1</code>, <code>yes</code>, or <code>true</code> to enable; for all other values, the border is disabled.
===== border =====
+
; frame
: ''(optional)'' Whether to add a small grey border to the image. Use <code>y</code>, <code>1</code>, <code>yes</code>, or <code>true</code> to enable; for all other values, the border is disabled (the default).
+
: ''(optional, defaults to false)''<br>How to display the image. Use <code>y</code>, <code>1</code>, <code>yes</code>, or <code>true</code> to use a frame; <code>n</code>, <code>0</code>, <code>no</code>, or <code>false</code> to ''not'' use a frame; or <code>thumb</code>, or <code>thumbnail</code> for a thumbnail frame.
 
+
: See [https://www.mediawiki.org/wiki/Help:Images#Format the MediaWiki help page] for details.
===== frame =====
+
; size<span class="anchor" id="size"></span>
: ''(optional)'' How to display the image. Use <code>y</code>, <code>1</code>, <code>yes</code>, or <code>true</code> to use a frame; <code>n</code>, <code>0</code>, <code>no</code>, or <code>false</code> to ''not'' use a frame (the default); or <code>thumb</code>, or <code>thumbnail</code> for a thumbnail frame. See [https://www.mediawiki.org/wiki/Help:Images#Format the MediaWiki help page] for details.
+
: ''(optional)''<br>The resizing option. Takes priority over [[#2|the positional parameter #2]].
 
+
: See [https://www.mediawiki.org/wiki/Help:Images#Syntax the MediaWiki help page] for details.
===== size =====
+
; halign
: ''(optional)'' The resizing option. Defaults to the [[#2|positional parameter 2]].
+
: ''(optional, defaults to showing the image inline)''<br>The horizontal alignment. Use <code>none</code> to prevent text from flowing around the image; <code>center</code> to prevent text flowing around and centre the image; <code>left</code> to align the image left; <code>right</code> to align the image right; or leave empty to show the image inline with text.  
 
+
: See [https://www.mediawiki.org/wiki/Help:Images#Horizontal_alignment the MediaWiki help page] for details.
===== halign =====
+
; valign
: ''(optional)'' The horizontal alignment. Use <code>none</code> to prevent text from flowing around the image; <code>center</code> to prevent text flowing around and centre the image; <code>left</code> to align the image left; <code>right</code> to align the image right; or leave empty to show the image inline with text (the default). See [https://www.mediawiki.org/wiki/Help:Images#Horizontal_alignment the MediaWiki help page] for details.
+
: ''(optional, defaults to middle)''<br>The vertical alignment.
 
+
: See [https://www.mediawiki.org/wiki/Help:Images#Vertical_alignment the MediaWiki help page] for details.
===== valign =====
+
; link
: ''(optional)'' The vertical alignment. See [https://www.mediawiki.org/wiki/Help:Images#Vertical_alignment the MediaWiki help page] for details. Defaults to <code>baseline</code>.
+
: ''(optional)''<br>The page or external link the image should link to. Leave empty to prevent adding a link.
 
+
; alt
===== link =====
+
: ''(optional, defaults to [[#1|the positional parameter #1]])''<br>The alternative text for screen readers or if the image can't be displayed.
: ''(optional)'' The page or external link the image should link to. Leave empty to prevent adding a link (the default).
+
; title
 
+
: ''(optional, defaults to [[#1|the positional parameter #1]])'' The text that should be displayed when hovering the mouse over the image.
===== alt =====
 
: ''(optional)'' The alternative text for screen readers or if the image can't be displayed. Defaults to the [[#1|positional parameter 1]].
 
 
 
===== title =====
 
: ''(optional)'' The text that should be displayed when hovering the mouse over the image. Defaults to the [[#1|positional parameter 1]].
 
  
 
== Examples ==
 
== Examples ==

Latest revision as of 18:02, 30 November 2024

Note: A list of all available minimap icons can be found under Category:Minimap Icons

Parameters

1
The minimap icon to show. Will be passed on to Template:MinimapIconFile as-is.
2
(optional, defaults to 16px)
The resizing option. Will only be used if the size parameter is not used.
See the MediaWiki help page for details.
border
(optional, defaults to false)
Whether to add a small grey border to the image. Use y, 1, yes, or true to enable; for all other values, the border is disabled.
frame
(optional, defaults to false)
How to display the image. Use y, 1, yes, or true to use a frame; n, 0, no, or false to not use a frame; or thumb, or thumbnail for a thumbnail frame.
See the MediaWiki help page for details.
size
(optional)
The resizing option. Takes priority over the positional parameter #2.
See the MediaWiki help page for details.
halign
(optional, defaults to showing the image inline)
The horizontal alignment. Use none to prevent text from flowing around the image; center to prevent text flowing around and centre the image; left to align the image left; right to align the image right; or leave empty to show the image inline with text.
See the MediaWiki help page for details.
valign
(optional, defaults to middle)
The vertical alignment.
See the MediaWiki help page for details.
link
(optional)
The page or external link the image should link to. Leave empty to prevent adding a link.
alt
(optional, defaults to the positional parameter #1)
The alternative text for screen readers or if the image can't be displayed.
title
(optional, defaults to the positional parameter #1) The text that should be displayed when hovering the mouse over the image.

Examples

  • {{MinimapIcon|Campsite}}Campsite
  • {{MinimapIcon|Miniboss|64px}}Miniboss
  • {{MinimapIcon|Station|frame=yes|valign=sup|link=Category:Mer-Line_stations}}
    Station
    Station