Template:Progress bar/doc: Difference between revisions

From Portals of Phereon Wiki
Content added Content deleted
No edit summary
No edit summary
 
Line 52: Line 52:
"label": "Header",
"label": "Header",
"description": "Turns the header on or off",
"description": "Turns the header on or off",
"type": "boolean"
"type": "boolean",
"default": "yes"
},
},
"total": {
"total": {
Line 62: Line 63:
"text": {
"text": {
"label": "Text",
"label": "Text",
"description": "The text that is displayed above the progress bar",
"description": "The text that is displayed above the progress bar, after the percentage",
"type": "string"
"type": "string"
},
},
Line 68: Line 69:
"label": "Height",
"label": "Height",
"description": "Height of the bar"
"description": "Height of the bar"
},
"task": {
"label": "Task",
"description": "This is showed before the percentage",
"example": "Completing stubs",
"type": "string"
}
}
},
},
Line 74: Line 81:
"total",
"total",
"header",
"header",
"task",
"text",
"text",
"width",
"width",

Latest revision as of 01:36, 1 September 2020

This is a documentation subpage for Template:Progress bar.
It contains usage information, categories and other content that is not part of the original template page.

Usage[]

{{Progress bar|value}}

This template draws a progress bar. By default, the value to supply as the parameter is the percent, from 0 to 100 (e.g. 1 would mean 1%, .1 would be 0.1%). The text label of the progress bar will always be rounded to the nearest tenth of a percent (rounding up if the hundreds digit is 5; e.g. 50.15 would round to 50.2%). If a value isn't specified or is invalid, the bar displays 0%. Values greater than 100% will display incorrectly, although the text label will be correct.

Optional parameters[]

  • height = height of the progress bar in pixels; defaults to 2
  • width = width of the progress bar; defaults to 75%
  • text = message to display after %; defaults to: completed
  • total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly
  • header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line

Examples[]

Default configuration[]

{{Progress bar|5}} :

5% completed

   

With custom header text[]

{{Progress bar|5|text=done}} :

5% done

   

Without header text[]

{{Progress bar|80|header=no|text=does not display here}} :

   

Custom height and width[]

{{Progress bar|80|height=8|width=50%}} :

5% completed

   

Custom total[]

{{Progress bar|5|total=5}} :

100% completed

   

Template data[]

Makes a progress bar

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Value1

The value that gets divided by the Total, or by 100 if it is missing

Numberrequired
Totaltotal

The total amount that the value is divided by

Default
100
Numberoptional
Headerheader

Turns the header on or off

Default
yes
Booleanoptional
Tasktask

This is showed before the percentage

Example
Completing stubs
Stringoptional
Texttext

The text that is displayed above the progress bar, after the percentage

Stringoptional
Widthwidth

Width of the bar

Unknownoptional
Heightheight

Height of the bar

Unknownoptional