Template:FloorNumber/doc

This is the current revision of this page, as edited by Alex (talk | contribs) at 17:59, 15 October 2024 (Created page with "{{Documentation}} The '''FloorNumber''' template outputs a textual floor reference, using the recommended British style; it takes an input of a <code>uk</code> parameter with a British floor numbering convention. A note is also provided to explain the floor reference to the reader when hovered over. ==Usage== ===Basic usage=== <pre> {{FloorNumber|uk=UK floor}} </pre> The <code>uk</code> parameter must be used to specify which f..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a documentation subpage for Template:FloorNumber.
It contains usage information, categories, and other content that is not part of the original template page.
Template:FloorNumber invokes function main in Module:FloorNumber using Lua.

The FloorNumber template outputs a textual floor reference, using the recommended British style; it takes an input of a uk parameter with a British floor numbering convention. A note is also provided to explain the floor reference to the reader when hovered over.

Usage

Basic usage

{{FloorNumber|uk=UK floor}}

The uk parameter must be used to specify which floor is being indicated, with the specified number indicating the British numbering convention (i.e. 0 for "Ground floor" in British convention). The user's preferences for their floor numbering will display the floor number for their given system. The way the two systems work are:

  • American style floors define the entrance (that is level with the outside ground) as the 1st floor, with floors incrementing above that (climbing one set of stairs puts you on the 2nd floor, then the 3rd floor, etc.).
  • British style floors define the entrance (that is level with the outside ground) as the ground floor, with floors incrementing above that (climbing one set of stairs puts you on the 1st floor, then the 2nd floor, etc.).

Optional other parameters

{{FloorNumber|uk=0|caps=y|nohelp=y}}

If caps=y, or the second unnamed parameter is set to 'caps', and if the floor is the ground floor, it will be capitalised as "Ground floor". No effect for other floors.

If nohelp=y, or the third unnamed parameter is set to 'nohelp', the tooltip is suppressed.

Auto-switching

This template uses code present in MediaWiki:Gadget-skinTogglesNew.js to automatically switch between British and American styles. By default this is done by detecting the user's browser locale - if it is one of en-US en-CA es-US fr-CA it uses American style, and British style otherwise. This can be overridden by the user in the skin toggles window (moon at the top of the window, with dark mode toggles).

It can also be overridden on a per-usage basis by using floornumber-override-gb or floornumber-override-us.

Examples

Examples in context, as template inputs and outputs, are below:

Template Result (UK) Result (US)
{{FloorNumber|uk=1}} 1st floor[UK]2nd floor[US] 1st floor[UK]2nd floor[US]
{{FloorNumber|uk=2}} 2nd floor[UK]3rd floor[US] 2nd floor[UK]3rd floor[US]
{{FloorNumber|uk=21|nohelp=y}} 21st floor22nd floor 21st floor22nd floor
{{FloorNumber|uk=0|caps=y}} Ground floor[UK]1st floor[US] Ground floor[UK]1st floor[US]

Notes

This template does not yet support basements, i.e. UK floors -1 and below, nor successive basements below those.

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

Outputs a textual floor reference, using the recommended British style; it takes an input in UK style numbering in the 'uk' parameter. A note is also provided to explain the floor reference to the reader when hovered over.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
United Kingdom-style floor numberuk

The number of the floor using the British numbering system, i.e. ground floor = 0, first floor = 1.

Example
1
Numberrequired
capscaps

Capitalises the first letter

Example
y
Auto value
y
Booleanoptional
nohelpnohelp

Suppresses help tooltip

Example
y
Auto value
y
Booleanoptional