Template:Routemap/doc

Template page

This category is an index of templates which use TemplateStyles. It is automatically populated by {{Uses TemplateStyles}}.


This template is used for constructing route diagram templates. It is the Lua-based successor of the {{BS-map}} templates, which have been superseded by {{Routemap}} on the English OODA WIKI but are still used on other wikis.

Usage

{{{title}}}
{{{top}}}
{{{footnote}}}
{{Routemap
|navbar		= 
|navbar pos	= 
|navbar mini	= 
|title		= 
|title color	= 
|title bg	= 
|bg		= 
|inline		= 
|collapsible	= 
|collapse	= 
|legend		= 
|legend alt	= 
|float		= 
|style		= 
|top		= 
|footnote	= 
|text-width	= 
|map		=
}}

Markup for map parameter

The markup for composing the diagram in the |map= parameter is different to the {{BSrow}}-based templates. The major differences are the separators in each row. Subtemplates are not necessary, since a new row in the table is simply created by a carriage return (newline).

{{Routemap
Add other parameters like |title= here.
|map=
Map markup goes here!
}}

Basic

Example 1.1
exCONTg
ENDExa
CONTgq\KRZu\CONTfq
BHF
\ABZgl\CONTfq
CONTf
icon ID\icon ID\icon ID
  • Icons are separated by the backslash \.
  • Each group of icons is centered in its row. The nameless icon (at the start of row 5 in the diagram) can be used as a spacer.
  • The ID of each icon can be seen in its tooltip. Move your cursor over the icons to see them.

Sidebar text

icon ID\icon ID\icon ID~~dist./time~~main text~~remark~~right remark

or

icon ID\icon ID\icon ID~~main text
{{Routemap
|title=Example 1.2
|map=
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
Example 1.2
terminus
Bridge
1 km
station
transfer for HSR
2 km
terminus
bus terminal
  • The third and fourth pairs of tildes can be omitted if there is no content following either of them.
  • After the last icon ID, if there is only one set of "tilde-tilde" (~~), the following text will be displayed in the main text cell instead of dist./time.
  • Separating text cells requires at least one empty space; otherwise the tildes will be treated as a signature.

Text cells in icon rows

*text\d*text\cd*text~~main text
{{Routemap
|title=Example 1.3
|map=
ENDEa~~ ~~ ~~Reversing siding
SPLa
cBS\vSTR\cBS~~Station
d*1\cBS\vSTR\cBS\d*2~~ ~~ ~~Platform numbers
cBS\vSTR\cBS
vCONTfge~~ ~~ ~~''to City''
}}
Example 1.3
Reversing siding
Station
1
2
Platform numbers
to City

The asterisk indicating a text cell can be preceded by one of the BSicons' width prefixes. (Normal BSicons are square.)

Letters o c d cd none b s bs w
Width 18 14 12 34 1 2 4 6 8

Icon overlay, icon link, background color and colspan

{{Routemap
|title=Example 2.1
|map=
-colspan-1
Icon overlay
uSTRq!~STR2!~BHF!~lHUB\\dSTR!~uSTRq\dSTR!~dNULf
-colspan-2-style=border-bottom:5px solid red;
----
icon link
utBHF!@Superhub
-colspan
----
background color
-colspan-end
utSTR~~ ~~ ~~ ~~ ~~bg=#7af
}}
Example 2.1

Icon overlay


icon link


background color

  • Overlay separator "exclamation mark-tilde" (!~) must follow the icon ID which is to be overlaid.
  • Overlay is practically unlimited, but legibility should be taken into account.
  • The width of the underlying icon determines the width of the combination, even if less than the overlay. The icons are aligned with their left edges together, so that they will not be centered on each other if they differ in width. If the overlay extends past the underlying icon, it will overlay the following icon (but not the following icon's overlay).
  • When using icon overlay and icon link for the same icon cell, the icon link separator (!@) must follow the last (top) overlaying icon ID.
  • The background color parameter (bg=) requires 5 sets of preceding text separators to be recognizable even if there is no text on that row whatsoever.

Other formatting options

Rows

{{Routemap
|title=Example 2.2
|map=
utSTR~~ ~~ ~~{{mono|1=bg=<abbr title="This is the normal BSicon color for watercourses.">#007CC3</abbr>}}~~ ~~bg=#007CC3
*1\*2\*3~~ ~~ ~~{{mono|1=color=red,bold=yes}}~~ ~~color=red,bold=yes
*A\*C\*E~~ ~~ ~~{{mono|1=align=l,b=1,fontsize=cmt}}~~ ~~align=left,b=1,fontsize=cmt
*B\*D\*F~~ ~~ ~~{{mono|1=colour=orange, align=b, i=y}}~~ ~~colour=orange, align=b, i=y
}}
Example 2.2
bg=#007CC3
1
2
3
color=red,bold=yes
A
C
E
align=l,b=1,fontsize=cmt
B
D
F
colour=orange, align=b, i=y

Aside from bg=, there are several other parameters, separated by commas (,), which can be used to customize the display of a row. Only bg= can be used to change the display of icons; all others only affect text cells.

Row parameters
Parameter name Values Result
bg=, background= or bgcolor= Any X11 color name, RGB hex triplet or other valid values of the CSS background property Row background is colored
color= or colour= Any X11 color name or RGB hex triplet Text cells in a row are colored
b= or bold= 1, yes, y or true Text cells in a row are emboldened
i=, it= or italic= 1, yes, y or true Text cells in a row are italicized
align= No or invalid value Text in cells is centered horizontally and vertically
l or left Text in cells is aligned to the left
r or right Text in cells is aligned to the right
a, t or top Text in cells is aligned to the top
e, b or bottom Text in cells is aligned to the bottom
la, tl, c4, nw, top-left or topleft Text in cells is aligned to the top-left corner
ra, tr, c1, ne, top-right or topright Text in cells is aligned to the top-right corner
le, bl, c3, sw, bottom-left or bottomleft Text in cells is aligned to the bottom-left corner
re, br, c2, se, bottom-right or bottomright Text in cells is aligned to the bottom-right corner
fontsize= No value Text in cells is 10px high and is transformed to be narrower (example)
info or main Text in cells is the same size as the large sidebar text (second column from center)
cmt or comment Text in cells is the same size as the small sidebar text (other columns)
Any valid values of the CSS font-size property Text in cells is a different size (percentages are relative to the large sidebar text)

Individual cells/icons

icon!_bg=purple\*text__align=l!~*more text__align=r,b=yes
  • Parameters for a single icon or text cell (e.g. BHF, *Text) are preceded by two underscores (__).
  • Parameters for the contents of a table cell (a stack of overlaid objects, or a single icon or text box with no overlays) are preceded by an exclamation mark and an underscore (!_). This must follow the link (if any).
  • For the last overlaid item in a stack, the individual item parameters (if any) must precede the stack parameters.
  • Most of the parameters are the same as those for rows, but there are a few additional ones. Additionally, the values for align=, bg= and color= will override the row parameter values.
Icon, text box and overlay stack parameters
Parameter name Values Result
bg=, background= or bgcolor= Any X11 color name, RGB hex triplet or other valid values of the CSS background property Background is colored
This should not be used with overlays above icons.
color= or colour= Any X11 color name or RGB hex triplet All the text of a cell, or the text of an individual text box, is colored
b= or bold= 1, yes, y or true Boldfaced text
i=, it= or italic= 1, yes, y or true Italicized text
align= No or invalid value Text is aligned per parameters of its parent (default: centered vertically and horizontally)
l or left Text is aligned to… (vertical / horizontal)
"Inherit" indicates that the cell will inherit its parent's value for that axis.
inherit left
r or right inherit right
a, t or top top inherit
e, b or bottom bottom inherit
la, tl, c4, nw, top-left or topleft top left
ra, tr, c1, ne, top-right or topright top right
le, bl, c3, sw, bottom-left or bottomleft bottom left
re, br, c2, se, bottom-right or bottomright bottom right
c, center or centre inherit center
m or middle middle inherit
ma, tc, top-center, top-centre, topcenter or topcentre top center
me, bc, bottom-center, bottom-centre, bottomcenter or bottomcentre bottom center
lm, ml, middle-left or middleleft middle left
rm, mr, middle-right or middleright middle right
cm, mc, middle-center, middle-centre, middlecenter or middlecentre middle center
fontsize= No value Text is 10px high and is transformed to be narrower (example)
info or main Text is the same size as the large sidebar text (second column from center)
cmt or comment Text is the same size as the small sidebar text (other columns)
Any valid values of the CSS font-size property Text is a different size (percentages are relative to the large sidebar text)
abbr= Pretty much anything that doesn't mess up the MediaWiki markup Text has dotted underline and a tooltip containing the text after abbr=
This will not have any effect if used on an overlay stack.

Collapsible

{{Routemap
|title=Example 3.1: Basic collapsible
|text-width=80
|map=
-startCollapsible-collapsed
\KBHFa\~~terminus
hSTRa@g
WASSERq\hKRZW\WASSERq~~ ~~ ~~ ~~bridge
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
Example 3.1: Basic collapsible
terminus
bridge
station
transfer for HSR
terminus
bus terminal
{{Routemap
|title=Example 3.2:<br/>Mixed odd and even rows
|tw=70
|map=
-startCollapsible-collapsed
d\KBHFa\d~~terminus
hKRZWae~~ ~~ ~~bridge
-endCollapsible-
BS2+l\BS2+r~~junction
}}
Example 3.2:
Mixed odd and even rows
terminus
bridge
junction
  • Adjust |text-width= (or |tw=) parameter until there is no break.
    • Unit is "px" by default, but other units such as "em" are acceptable.
    • Check the map in different browser and in mobile view, and increase text-width if it breaks.
  • The icon number of the first row of collapsible section must be equal to or greater than the icon number of the widest non-collapsible row.
    • As in example 3.2, use half-width empty icon   (d) as filler when you are mixing both odd and even rows in the same map.
  • Changing "collapsed" to "nil" will change the default state of the collapible section to uncollapsed.

Collapsible replacement

{{Routemap
|title=Example 4.1
|text-width=150
|map=
KBHFa~~terminus
-startCollapsible-collapsed-replace
\LSTR\~~hidden section
\hSTRa@g\
WASSERq\hKRZW\WASSERq~~ ~~ ~~viaduct
hSTRe@f
-endCollapsible-
LDER\INT\~~ ~~station~~transfer for HSR
\KBHFe\BUS~~ ~~terminus~~bus terminal
}}
Example 4.1
terminus
hidden section
viaduct
station
transfer for HSR
terminus
bus terminal
{{Routemap
|title=Example 4.2: Empty filler
|text-width=150
|map=
-startCollapsible-collapsed-replace
exCONTg~~under construction
leer
exKBHFa~~future terminus
exBHF~~future station
-endCollapsible
KBHFxa~~terminus
KBHFe~~terminus
}}
Example 4.2: Empty filler
under construction
future terminus
future station
terminus
terminus
  • Both replacement and replaced rows must be as wide as the widest non-collapsible row in the diagram.
  • If you want to hide the replaced row after expanding the collapsible, use icon   (leer) as empty filler as in example 4.2.
  • In any case, mind to provide a sufficient text-width. Here, using text-width=120 would break the alignment of the icons.
  • Collapsible elements are intentionally disabled in mobile view, so the replaced row will never be visible. Keep this in mind while creating a diagram.

Dual text sidebar

For larger and more complicated diagrams, it often helps to have a text sidebar on the left as well as the right.

left-left remark~~left remark~~left main text~~left dist./time! !icon ID~~right dist./time~~right main text~~right remark~~right-right remark

or

left main text! !icon ID~~right main text
{{Routemap
|title=Example 5
|map=
~~km! !~~km~~
commuter terminus~~0! !uKBHFa\\KBHFa~~0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~ ~~ ~~bridge
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2! !uKBHFe\\KBHFe~~2~~regional terminus
}}
Example 5
km
km
commuter terminus
0
0
regional terminus
River Boris
bridge
transfer for HSR
station
1
commuter terminus
2
2
regional terminus
  • Left text cells require "exclamation mark-space-exclamation mark" (! !) separating them from icon cells.
  • If there is no "tilde-tilde" (~~) separator to the left of "exclamation mark-space-exclamation mark", the text to the left of the separator will be displayed in the left main text cell.

Dual text sidebar collapsible

Code Result
{{Routemap
|title=Example 6.1: All text cells applied
|text-width=,130,,,110,
|map=
~~km! !\\~~km~~
-startCollapsible
commuter terminus~~0{{0|00}}! !uKBHFa\leer\KBHFa~~{{0|00}}0~~regional terminus
River Boris~~ ~~! !uhKRZWae\WASSERq\hKRZWae~~~~ ~~bridge
-endCollapsible
transfer for HSR~~station~~1! !uINT\LDER\LSTR
commuter terminus~~2{{0|00}}! !uKBHFe\\KBHFe~~{{0|00}}2~~regional terminus
}}
Example 6.1: All text cells applied
km
km
commuter terminus
000
000
regional terminus
River Boris
bridge
transfer for HSR
station
1
commuter terminus
200
002
regional terminus
{{Routemap
|title=Example 6.2: Only main text cell applied
|style=width:380px
|text-width=,120,,,120,
|map=
-startCollapsible
commuter terminus! !uKBHFa\\KBHFa~~regional terminus
River Boris! !uhKRZWae\WASSERq\hKRZWae~~bridge
-endCollapsible
station! !uINT\LDER\LSTR
commuter terminus! !uKBHFe\\KBHFe~~regional terminus
}}
Example 6.2: Only main text cell applied
commuter terminus
regional terminus
River Boris
bridge
station
commuter terminus
regional terminus
  • Apply |text-width= to eliminate the break:
    • Only 1 value: right main text+right remark
    • 3 values, separated by commas: right dist./time,right main text+right remark,right-right remark
    • 6 values: Left-left remark,left remark+left main text,left dist./time,right dist./time,right main text+right remark,right-right remark
    • If the number of values is not equal to 1, 3 or 6, the entire parameter will be ignored.
  • If the text width of right-right remark is smaller than needed, its width definition can be omitted, as in example 6.1.
  • If a specific text cell is not used anywhere on the map, that width definition can be omitted, as in example 6.2.
  • Define the general table width with the {{{style}}} parameter if {{{text-width}}} alone cannot prevent a break.
  • If the empty icon cell of the collapsible row is being squashed, use empty icon   (leer) to correct the icon columns.

Filler rows

Code Result
{{Routemap
|title=Example 7
|map=
uKBHFa!~HUBaq\HUBq\KBHFa orange!~HUBeq
-filler--#003399\\#FF6600
uBHF!~HUBaq\KBHFa!~HUBq\BHF orange!~HUBeq
-filler--u\-\orange
uKBHFe!~HUBaq\KBHFxe!~HUBq\KBHFxe orange!~HUBeq
-filler-80px-\ex\ex_orange~~ ~~ ~~Sample<br>text~~ ~~bg=#007CC3
\exKBHFe!~HUBaq\exKBHFe orange!~HUBeq
}}
Example 7
Sample
text

Syntax overview

Syntax Purpose
\ Icon separator
!~ Icon overlay
!@ Icon link
!_ Precedes icon stack formatting parameters
__ Precedes icon formatting parameters
~~ Text separator
! ! Separator between icons and left-column text
key=value,... Formatting parameters
-startCollapsible Start of collapsing section
-endCollapsible End of collapsing section
-colspan Start of non-diagram table cell
-colspan-end End of non-diagram table cell
-colspan-n Start of non-diagram table cell; next n lines of code are in that cell (n can be any positive whole number)
-filler-... Start of filler row

Transition from legacy BS row template to Routemap markup

Conversion policies

Many contributors of the English Route Diagram Template project during the implementation of Routemap have conflicting opinions about the justification of replacing all maps of legacy BS row templates by the Lua-based Routemap. Opponents deem the map markups of Routemap to be too esoteric for editors unfamiliar with Routemap markup to modify. While proponents support a complete conversion for better performance. There is no consensus reached at the moment so any transition without massively updating the map appearance for reflecting service and/or structural change in reality should only be done with the following considerations:

  • The map of the legacy BS row template design has exceeded template size limit in the transcluding page, which means the template does not expand into its intended appearance but only the link to the template page is shown, so there is an imminent need to translate the map into Routemap design to reduce post-expand include size.
  • If there is no template size issue, respect the preference of the initial contributor of the first completed version of the diagram. If that contributor contests the change to Routemap, retain the BS row template design.

Technical options

All BS row templates have had substitutable counterparts created; hence conversion can be easily done by prepending subst: and appending /safesubst to every BS row template name in the map. For example, change {{BS2|STR|BHF|0|1|2|3|O1=uSTRq}} in the map to {{subst:BS2/safesubst|STR|BHF|0|1|2|3|O1=uSTRq}}, then publish changes; it will produce STR!~uSTRq\BHF~~0~~1~~2~~3. The process can be sped up by using the "replace all" function of advanced edit tool or separate text editor such as Notepad or Notepad++, but the search rule for the BS row templates should ideally be a regular expression, like \{\{(BS\d*(\-2)?)\|{{subst:$1/safesubst|, in order to avoid templates with similar names such as BSto and BSsplit in case they are present in the map.

"Column mode editing" can avoid the trouble of find and replace to add safesubst: on all rows efficiently. This function is common in advanced text editors like Geany,[1] Notepad++[2] and Sublime Text[3].

You can also use the "convertbs" function of Module:Routemap.

Function convertbs

Copy and paste the following code to any edit area of this wiki, maybe the map page you are working on:

{{#invoke:Routemap|convertbs|<nowiki>

</nowiki>}}

Then copy and paste the original BS-map or BS-table map code between the <nowiki> tags (alternatively paste the invoke convertbs header before the original map code and the </nowiki>}} ending after the map code) and show preview. It will generate the safesubst version and show the original versions (for comparison) of the map code. You copy the safesubst code from the preview area back to the edit area, and you should remove everything of #invoke:Routemap|convertbs if the preview of the new code works properly.

On the English OODA WIKI, the template

This template, often abbreviated as {{}}, is used to provide stylized formatting to template displays without actually using the template itself. The code generated will be displayed inline. For a multi-line output, see {{tj}}.

Parameters

With the exception of alttext, the named parameters are toggles that are either omitted (default in most cases) or activated (by being assigned a value such as "on", "yes", "true", "include", etc.). They may be included in any order (see Examples below). Certain templates have the parameter "on" by default; see the main table for all alternate options.

Parameter Action Use with
{{example}}
Default active
Default (without accessory parameters) {{example}}
brace Include braces as part of the template link {{example}} {{tlw}}/{{tn}}
braceinside Include innermost braces as part of the template link {{example}}
bold Renders the template link/name in bold {{example}} {{tlb}}, {{tlxb}}
code Display output using HTML ‎<code>...‎</code> tags (monospaced font) {{example}} {{tlc}}, {{Template link expanded}}, etc.
italic Display any parameters accompanying the template link/name in italics {{example|param}} {{tlxi}}
kbd Display output using HTML ‎<kbd>...‎</kbd> tags (monospaced font) {{example}}
nolink Don't render the template name as a link {{example}} {{tlf}}, {{tnull}}
nowrap Prevent the insertion of line breaks (word wrap) in the output {{example}}
nowrapname Prevent word wrapping in the output of template name/link (parameters will wrap if needed) {{example}}
plaincode Uses ‎<code style="border:none; background:transparent;">...‎</code> {{example}} {{tltss}}
subst Include a subst: prefix before the template link/name {{subst:example}} {{tls}}, {{tlxs}}, etc
alttext=[text] Replace [text] with the actual label to be displayed for the template link {{Other}} {{tla}}
_show_result Will also display the result of the template {{Min|7|-5}} → -5
_expand Will add a link to the expanded template page {{Min|7|-5}} [4]

Unnamed (Positional)

This template can take any number of unnamed parameters as parameters accompanying the template link (or name); see Examples below.

Examples

Code Output Remarks
{{convertbs|Banner}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Template:Banner does not exist. (Non-existent template is redlinked.)
{{convertbs|Abc}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Template:Abc exists.
{{convertbs|abC}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Template names are case-sensitive
{{convertbs|abc}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} (but the first letter is case-insensitive).
{{convertbs|x0}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} no parameters
{{convertbs|x1|one}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} one parameter
{{convertbs|x2|one|two}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} two parameters
{{convertbs|x3|1|2|3|4|5|6|7|8|9|10}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} ten parameters
{{tlg|convert|<nowiki>14|m|ftin|abbr=out|sp=us</nowiki>}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Unlimited parameters, as one ‎<nowiki>...‎</nowiki> string.
{{convertbs|x2||two||}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Empty parameters are discarded.
{{convertbs|x0|code=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} <code> style
{{convertbs|x0|plaincode=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} plaincode style
{{convertbs|x0|kbd=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} <kbd> style
{{convertbs|x0|bold=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} bold link/name
{{convertbs|x1|one|italic=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} parameter(s) in italics
{{convertbs|x0|nolink=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}}
{{convertbs|x0|subst=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}}
{{convertbs|x0|brace=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} all braces in link
{{convertbs|x0|braceinside=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} inside braces in link
{{convertbs|x0|alttext=x0 link}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}}
{{convertbs|x0|bold=on|code=on|brace=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Combine multiple parameter settings.
{{tlg|x1|{{spaces}}one{{spaces}}}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Using {{spaces}} before and after a parameter.
{{convertbs|x2|bold=on|code=on|one|two}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Can combine named and anonymous parameters ...
{{convertbs|x2|one|two|bold=on|code=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} ... in any order ...
{{convertbs|x2|one|code=on|two|bold=on|three}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} ... even intermixed ...
{{convertbs|x2|one|code=on|two|bold=on|three|italic=on}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} ... with many configurations.
{{tlg|x1|x=u}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} = won't work
{{tlg|x1|x&#61;u}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} &#61; is okay
{{tlg|x1|x{{=}}u}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} {{=}} is okay (see Template:=)
{{tlg|x1|x<nowiki>=</nowiki>u}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Sticky nowiki is okay.
{{convertbs|x2|3=two|2=one}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}}
Right-to-left is okay
{{convertbs}} convertbs With no arguments, it emits the current page name without braces.
{{convertbs|x2|3=one|4=two}} {{subst:((}}#invoke:Routemap{{subst:!}}convertbs{{subst:!}}<nowiki>{{subst:#invoke:Separated entries|main|separator={{subst:!}}}}</nowiki>{{subst:))}} Null parameter stops parsing.
Wrapping of long names (default)
Code Output
{{convertbs|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} main|separator={{subst:!}}}}</nowiki>{{subst:))}}
Wrapping of long names (nowrap=on)
Code Output
{{convertbs|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} main|separator={{subst:!}}}}</nowiki>{{subst:))}}
Wrapping of long names (nowrapname=on)
Code Output
{{convertbs|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} main|separator={{subst:!}}}}</nowiki>{{subst:))}}

See also

General-purpose formatting

Comparison of template-linking templates according to the styles of generated text and link produced
Text style ↓ {{tlg}} options[note 1]
to achieve text style
Link style
Linked Unlinked Linked with subst Unlinked with subst Linked including braces Linked with alternative text
{{tlg}} options[note 1]
to achieve link style
DEFAULT nolink=yes subst=yes nolink=yes|subst=yes braceinside=yes alttext=Foo
2=Foo
normal DEFAULT {{tlg}}[note 1]
{{tl}}
{{tlp|1|2|...}}[note 2]
{{Template:tlu}}[note 3]
{{tlf}}[note 2]
<template link>
Template loop detected: Template:Tls
{{subst:Template:tlsu}}[note 3]
{{subst:tlsf}}[note 2]
<template link>
{{tn}} {{tla}}
code code=yes {{tl2}}
{{tlx}}
{{Template:tlxu}}[note 3]
{{tlc}}[note 2]
<template link>
{{tnull}}<template link>
{{subst:tlxs}} {{subst:tlsc}}[note 2]
<template link>
monospace plaincode=yes[note 4] {{subst:tltss}}[note 5]
kbd kbd=yes[note 5]
bold bold=yes {{tlb}}
bold+code bold=yes|code=yes {{tlxb}}
italic+code italic=yes|code=yes {{tlxi}}
  1. 1.0 1.1 1.2 {{tlg}} is the most general template, allowing any combination of text style and/or link style options.
  2. 2.0 2.1 2.2 2.3 2.4 Prevents wrapping of text by placing it inside ‎<span class="nowrap">...‎</span> tags.
  3. 3.0 3.1 3.2 Allows links to templates in any namespace.
  4. {{tlg|plaincode=yes}} uses ‎<code style="border:none; background-color:transparent;">...‎</code>.
  5. 5.0 5.1 Displays monospaced font using ‎<span style="font-family:monospace;">...‎</span>.

Other formatting templates

Templates producing specialised formatting effects for given templates, modules or parameters
Code example Effect Notes
{{Tj|Hatnote|Some text|selfref: yes|category: no|lang: fr}}
{{Hatnote
| Some text
| selfref = yes
| category = no
| lang = fr
}}
Supports colors, placeholder texts, named and unnamed parameters
<syntaxhighlight lang="wikitext">
{{Hatnote
   | Some text
   | selfref = yes
   | category = no
   | lang = fr
}}
</syntaxhighlight>
{{Hatnote
    | Some text
    | selfref = yes
    | category = no
    | lang = fr
}}
Same as above
{{Tji|Hatnote|Some text|selfref: yes|category: no|lang: fr}} {{Hatnote|Some text|selfref=yes|category=no|lang=fr}} Supports colors, placeholder texts, named and unnamed parameters
<syntaxhighlight lang="wikitext" inline>{{Hatnote|Some text|selfref=yes|category=no|lang=fr}}</syntaxhighlight> {{Hatnote|Some text|selfref=yes|category=no|lang=fr}} Same as above
{{tl2|Hatnote|lang=fr}} {{hatnote}} Supports linking to sister projects (e.g., fr:Hatnote)
{{demo|<nowiki>{{Hatnote|lang=fr|Some text}}</nowiki>}}
{{hatnote|lang=fr|Some text}}
Shows code and example
{{tln|Hatnote}} Template:Hatnote Produces a normal link to the template
{{elc|Template:Hatnote}}
{{elc|Template:Hatnote|Hatnote}}
[[Template:Hatnote]]
[[Template:Hatnote|Hatnote]]
Formats wikilink, with optional piped link text and blended suffix
{{ml|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{tl}} for linking to Lua modules
{{mfl|Example|hello}} {{#invoke:Example|hello}} Similar to {{ml}}, but expects the function to be documented and creates a link to the corresponding section
{{mlx|Example|hello}} {{#invoke:Example|hello}} Counterpart to {{tlx}} for linking to Lua modules
{{ml-lua|Module:Example|hello}} require('Module:Example') Link to Lua modules and built-in libraries, showing Lua code.
{{para|title|<var>book title</var>}} |title=book title Formats template parameters for display, with or without values
{{sclx|LASTING}} [[WP:LASTING]] Takes a shortcut suffix in project namespace and displays it with brackets and the WP: alias in a ‎<code>...‎</code> tag.
{{tag|ref}}
{{xtag|templatedata}}
‎<ref>...‎</ref>
<templatedata>
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing
{{dtl|Ping project}} {{d:Ping project}} Wikidata counterpart to {{tl}}
{{pf|if}}
{{pf|if|{{{1}}}|true|false}}
{{#if}}
{{#if:{{{1}}}|true|false}}
Parser function equivalent to {{tl}}
{{magic word|uc:}} {{uc:}} Magic word links

With utility links

Templates producing utility links for a given template (Hatnote used here as example)
Code example Effect
{{lt|Hatnote}} [[Template:]] 
{{lts|Hatnote}} Template:Hatnote(edit talk links history)
{{t links|Hatnote}} {{Hatnote}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)
{{tfd links|Hatnote}} Template:Hatnote (talk · history · transclusions · logs · subpages)
{{tetl|Hatnote}} {{Hatnote}}
links talk edit
{{tsetl|Hatnote}} {{subst:Hatnote}}
 links talk edit
{{ti|Hatnote}} {{Hatnote}}
{{tic|Hatnote}} Template:Hatnote (talk links edit)
{{tim|Hatnote}} m:Template:Hatnote (backlinks edit)
{{tiw|Hatnote}} Template:Hatnote (backlinks edit)
{{tlt|Hatnote}} {{Hatnote}} (talk)
{{ttl|Hatnote}} {{Hatnote}} (t/l)
{{twlh|Hatnote}} Template:Hatnote (links, talk)
can be used as a shortcut:
{{subst:convertbs|1=

}}

If it doesn't work, it's possible that you haven't copied some of the relevant code, such as table markup for BS-table diagrams, or that you've copied code which actually belongs to something else.

Example
{{#invoke:Routemap|convertbs|<nowiki>
{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
</nowiki>}}
Result

Safe substitution:

{{Routemap
|title=Demonstration
|map=
{{safesubst:BS/safesubst|KBHFa|0 km|A station|Shuttle bus}}
{{safesubst:BS3/safesubst|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{safesubst:BS/safesubst|KINTe|10 km|B station|City hub}}
-colspan-2
----
Not to scale
}}

Original:

{{BS-map
|title=Demonstration
|map=
{{BS|KBHFa|0 km|A station|Shuttle bus}}
{{BS3|WASSERq|hKRZWae|WASSERq||||{{BSsplit|Suburb|Capital}}}}
{{BS|KINTe|10 km|B station|City hub}}
{{BS-colspan}}
----
Not to scale
}}
Copy safe substitution markup for actual usage
Demonstration
0 km
A station
Shuttle bus
Suburb
Capital
10 km
B station
City hub

Not to scale

Embedding into infobox

  • Use {{{inline}}} to remove title bar and table border. If creating a separate template which will be embedded into an infobox, wrap inline=1 in ‎<includeonly>...‎</includeonly> tags. Also {{{navbar pos}}} is helpful to locate the {{Navbar}} better.
{{Infobox station
| name = {{color box|orange}} Station layout
| image = Placeholder.png
| image_upright = 0.5
| image_caption = Platform level
| opened = {{Start date|1935|05|15|df=y}}
| tracks = 2
| route_map =
{{routemap|inline=1|navbar=asd|navbar pos=2|
KBHFa~~terminus
WASSERq\hKRZWae\WASSERq~~ ~~ ~~ ~~Bridge
LDER\INT\~~1 km~~station~~transfer for HSR
\KBHFe\BUS~~2 km~~terminus~~bus terminal
}}
}}
  Station layout
File:Placeholder.png
Platform level
General information
Tracks2
History
Opened15 May 1935 (1935-05-15)
Route map
terminus
Bridge
1 km
station
transfer for HSR
2 km
terminus
bus terminal

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template in articles based on this TemplateData.

TemplateData for Routemap

Template for displaying diagram composed of icon images and text labels in uniform style.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Inline stateinline

Remove title bar and border for transclusion in infobox

Stringoptional
Table titletitle

Official title of the system. Value «no» will remove the table title row, but this will also disable the table collapsible switch as well

Stringoptional
Title font colortitle color title-color

Color of the title's text; automatically black or white to contrast with the title background color. Only use colors that contrast well with the background color

Default
#FFF or #252525; depends
Stringoptional
Title background colortitle bg color title-bg

Background color of the title

Default
#27404E
Stringoptional
Collapsibilitycollapsible

Whether the whole infobox is collapsible or not

Stringoptional
Collapsing statecollapse collapsed

Collapsing state. Shown by default. Any value will make the table collapse by default

Stringoptional
Template name for Navbarnavbar

This must exactly match the diagram template page name so the Navbar template will appear and link to the template page

Stringoptional
Position of the Navbarnavbar pos

Position of the Navbar template. Float to left in the title bar by default; «1» for top-left corner of the map (just under the title bar); «2» for the middle bottom of the map

Stringoptional
Small navbarnavbar mini

If the navbar is not in default position, then this changes whether the navbar displays as "V · T · E" (default for navbar pos 1; values: «1», «y», «yes», «true») or "This diagram: view · talk · edit" (default for navbar pos 2; values: «0», «n», «no», «false»).

Stringoptional
Legend appearancelegend

Alias of the legend link. It can be «bus», «canal», «footpath», «road» or «track». «0» or «no» for no legend at all

Default
Template:Railway line legend
Page nameoptional
Legend link textlegend alt

Different link name in place of «Legend» if desirable

Default
Legend
Stringoptional
Floating statefloat

Floating state of the whole box: «right» by default; optionally «left» or «none»

Default
right
Stringoptional
Background colorbg

Background color of the whole map area

Default
#F9F9F9
Stringoptional
CSS style valuesstyle

Additional CSS style definition of the whole infobox

Stringoptional
Top notetop on top

Space for optional note or infobox above the map

Stringoptional
Bottom notefootnote bottom

Space for optional note or infobox below the map

Stringoptional
Width of map text celltext-width tw

Extend the width of the map text cell so the collapsible section within the map does not break

Stringoptional
Map markupsmap 1

Map data which uses specific markup/separators to load icon image and arrange the text in the uniform style. Use "map2", "map3" etc. for additional maps

Stringrequired
Map titlemap-title

Title of map. Use "map2-title", "map3-title" etc. for titles of addition maps

Stringoptional