Error: Missing parameters. Usage: {{Bar|<type>|<number>|<options>}}
Renew this page to show changes
Template documentation follows |
---|
Note: the template above may sometimes be partially or fully invisible. |
Visit Template:Bar/doc to edit this documentation. (How does this work?) |
Description
This template creates a bar of similar icons.
It is the most comfortable and powerful version of the bar templates and should be called by the wiki pages. It uses the {{Bar main}} template.
It handles
- Missing parameters.
- Displaying plain text if non-numeric.
- Calculating price ranges.
- Avoid the whole display wrapping around lines.
It handles not
- Display the bar of icons itself (including ranges and tags) -> Uses the {{Bar main}} template for that.
Syntax
Type {{Bar|<type>|<number>|<options>}}
somewhere.
<type>
is the basic filename e.g.armour
. The user must first provide a couple of images in advance:0armour.png, 1armour.png, ..., 10armour.png
to be able to display the respective icon bar. The images (at least that for 10) must have a small clear left margin, so when joined together, they look equally distributed. Defaut ishearts
. There is a special display forcoins
andprice
.<number>
is the number of icons to be displayed. The number must be numeric and will be rounded to the nearest integer. Default is0
. If no number is provided, this text is returned, nothing else (old usage of info-boxes). The<number>
can also be a range of two numbers17-23
and then will dispay two bars for the respective numbers. Either<type>
or<number>
must be specified.<options>
the options are so far:ext=<extension>
extension of the filename.jpg, .gif, ...
default is.png
size=<size>
height of the bar in px. Default is original size.
You can also use a symbolic name here, likeinfobox
, which selects a predefined size as defined in the {{Bar height}} template.notag=1
to suppress the number tag around the bar. Default is tag shown.tooltip=<text>
to define the text, which is shown, when hovering over the bar, default is the<number>
parameter.link=<text>
to define the link, where the bar links to. Defaults are defined in the {{Bar link}} template.
Samples
type this | to get this |
---|---|
{{Bar}} No parameters -> error. |
Error: Missing parameters. Usage: {{Bar|<type>|<number>|<options>}}
|
{{Bar||4}} No type -> defaut type. |
4 (![]() |
{{Bar|hearts}} No number -> default number. |
0 (![]() |
{{Bar|hearts|some text}} Non numeric -> plain text. |
some text |
{{Bar|hearts|6.9}} Rounding numbers to next integer. |
6.9 (![]() |
{{Bar|food|83.5}} Large numbers -> compacted display. |
83.5 (42 x ![]() |
{{Bar|coins|243.7}} Coins -> special display. |
243.7 (![]() ![]() ![]() |
{{Bar|price|20}} Price -> a range of coins is calculated. The number is the average price. Don't use a span here. |
15-25 (![]() ![]() ![]() ![]() |
{{Bar|price|+20}} Price -> a "+" denotes a price for an enchanted item. |
23-38 (![]() ![]() ![]() ![]() |
{{Bar|hearts|4-8}} Range defined. |
4-8 (![]() ![]() |
{{Bar|food|2+4.2 - 8+2-1}} Even equations (except for -). |
2+4.2 - 8+2-1 (![]() ![]() |
{{Bar||5|ext=.jpg}} Extension specified -> not .png. |
5 ( 5 ) |
{{Bar|armour|8.3|size=9}} Different size. |
8.3 (![]() |
{{Bar|armour|5|size=infobox}} Predefined size. |
5 (![]() |
{{Bar|food|4.3|notag=1}} Tag suppressed -> no # (). |
![]() |
{{Bar||10|tooltip=my health}} Tooltip defined. |
10 (![]() |
{{Bar money|2345|link=Corn}} Link defined. |
23 x ![]() ![]() ![]() |