Wikipedia:Route diagram template/Transwiki guide
Route diagram template (RDT) project involves lots of templates to be functional, in order to allow the map in other Wiki which has not yet adopted this project to display correctly, you will need to copy the required templates carefully. If you have more questions regarding transwikiing this project, go to the home discussion page, Wikipedia talk:Route diagram template, and leave the message.
Icon
You do not need to upload any icons to your local Wiki because they are shared in Wikimedia Commons. However, if your Wiki project is not directly affiliated to Wikimedia Foundation such as Wikia, you do need to upload all the license-free icons to your local Wiki web space, or enable InstantCommons if possible. You can find all the icons of this project in Commons:category:BSicon and its subcategories, or check the catalog of pictograms for list of explanation of the icons. For starter, you will at least need (
KBHFa
), (
BHF
), (
STR
) and (
KBHFe
) to compose the most basic map.
Module and template
Since 2013, Lua module has been created to replace to original method of stacking BS row templates repeatedly to form the route map which not only improves the loading speed and resource usage, but also provides unlimited horizontal icon columns and overlapping layers. The Routemap module is being developed and tested in Russian Wikipedia. Ongoing updates are expected but the overall format of forming the basic route map is already stable, so Wikimedia projects have not yet adapted the RDT project are recommended to directly copy the module and transcluding template from Russian Wikipedia and make minor adjustments if needed. Notice that the namespaces of "Module" and "Template" in Russian are "Модуль" and "Шаблон" respectively. These should be changed to English or the language of your home project, otherwise the Russian namespaces are unrecognizable elsewhere.
The module itself will work perfectly without translating anything inside it (which are technically commented notes). The only real changes that should be made to the module is the width of the collapsible button which differ from language to language. These are at the lines ["row-collapsible-left-button-width"]
and ["row-collapsible-right-button-width"]
. Change the width values so they fit just the longest length of the show/hide and expand/collapse buttons.
The Russian transcluding template provides both English and Russian versions of named parameters. You may remove the Russian parameter names for the sake of loading speed (e.g. from {{{сворачиваемый|{{{collapsible|}}}}}}
to {{{collapsible|}}}
), or translate the Russian parameters names to the language of your Wikimedia project. Template document is still being translated to English at ru:Шаблон:Маршрутная карта/doc/en.
Transition from legacy BS template to Routemap module
Here shows the example of how the old and new methods will produce the similar route map:
Legacy | Lua module | result |
---|---|---|
{{BS-map |title=ABC Railway |collapsible=0 |map= {{BS|KBHFa||Terminus A}} {{BS3|WASSERq|hWSTR|WASSERq|||Bridge B}} {{BS3|BOOT|BHF|||Station C|ferry pier}} {{BS3|BS2c2|BS2lr|BS2c3|||Junction D}} {{BS2|KBHFe|STR||Terminus E}} {{BS2||STR||Crash site|O2=INCIDO}} {{BS2||KBHFe||Terminus F}} }} |
{{Routemap |title=ABC Railway |collapsible=0 |map= KBHFa~~Terminus A WASSERq\hWSTR\WASSERq~~ ~~ ~~Bridge B BOOT\BHF\~~ ~~Station C~~ferry pier BS2c2\BS2lr\BS2c3~~ ~~ ~~Junction D KBHFe\STR~~Terminus E \STR!~INCIDO~~Crash site \KBHFe~~Terminus F }} |
Template:BS-map |
When translating big map from legacy format to Lua, it would be a huge time saver to use the "search and replace" function of enhanced edit toolbar (which requires enabling last 2 options of toolbar in Preferences-Editing-Editor) or copy the map codes to a text editor (e.g. firstobject XML editor) capable of text replacement to do the transition and then copy it back to the wiki editor. Note that because the icon IDs are case-sensitive, you MUST check "match case" before proceeding replacement.
But before making any replacement, you should search carefully if the map has used the overlapping function (the "highlight all" option of find in some browser will help tremendously). If all overlapping parameters are lined up right after the icons of base and lower layer in the correct order, you can instantly apply the replacement of |O1=
,
|O2=
, etc. by
!~
. Otherwise you should reline the overlapping parameters and values manually before replacing so you do not need to guess or check back and forth for the correct order of superimposition after the change.
The other thing you should look carefully is the additional templates used inside the BS row template such as {{RoutemapRoute}} and {{Rail-interchange}}. The initial character following the vertical bar | in the template could conflict with the icon ID. For example, if you are going to replace
|K
by
\K
for
(
KBHFa
) and (
KRWl
) but there is also {{rmr|licon=u|Kingsland}}
in the map code, you may consider changing the replacing rule to more specific |KB
by
\KB
and
|KR
by
\KR
to avoid changing
{{rmr|licon=u|Kingsland}}
to {{rmr|licon=u\Kingsland}}
at the same time.
For templates like {{BSsplit}} and {{BSto}}, the first vertical bar after the template name should be replaced by {{!}} (e.g. replace
{{BSsplit|A|B}}
by
{{BSsplit{{!}}A|B}}
), otherwise the markups of the template will explode in the route map.
Legacy BS templates
The following content represents the legacy form of RDT. Editor is discouraged to use it unless there is a strong technical reason.
Template
This project was originally created by German Wikipedians, but since its adoption to English Wikipedia, the project/templates continue to expand while the German Wikipedians prefer to keep the project as simple as possible. However, because the English Wikipedia counterpart has a backward compatibility with the German code (map code in German Wikipedia technically works fine in English Wikipedia without additional modification), it is highly recommended to apply the English Wikipedia version.
Fundamental template
- {{Superimpose2}} & {{Superimpose2/base}} for the 5-layer icon overlapping function.
- {{BS-overlap}}
- {{BSpx}}
- {{BS-map}} & {{BS-map/map}}, you may need to translate the text "legend" if your Wiki is not in English. Also you may add more parameter definition of your home language in the "#switch:" parser which is applied to decide which legend page to be linked to. The following 3 templates are often used together for 1 map. On June 5, 2011 they were replaced by BS-map for the sake of simplicity. However, these templates are already widely used even outside of English Wikipedia. If you know you will be copying most of the existing maps to your home Wiki and do not want to bother with replacing them by BS-map, you should adopt these templates as well but tell the other editors to stop using them:
- {{Railway line header}}
- {{BS-header}}
- {{BS-table}}, may require translating the text "legend".
- {{Navbar}}, most Wikimedia projects already have this template adopted. If not, you may need to ask admin of your local Wiki to help because it requires editing common CSS page which is not open to normal user. If you do not want to bother with it, remove the transclusion of Navbar from BS-map and BS-header.
- {{BS-Infobox}}
- {{BS-alt}}
- BS-alt was created under the Wikipedia:alternative text for images guideline. However, the overwhelmingly large amount of the icons for this project proves this template too difficult to be maintained or translated. If you want to skip BS-alt by voiding the alt attribute of all icons in the BS row templates altogether, copy the {{BS-overlap/noalt}} to your BS-overlap instead.
Row template
The number in these row templates indicates how many grid the template provides to display the icon horizontally. Theoretically it can be expanded endlessly, 8 icons per row is enough in most cases. Otherwise the map will spread too far and other method of rendering the map is recommended over this project. Create more row templates on demand or the admin may delete the unused.
- {{BSrow}}, {{BS}}, {{BS2}}, {{BS3}}, etc.
- {{BSrow-sc}}, {{BS-startCollapsible}}, {{BS2-startCollapsible}}, {{BS3-startCollapsible}}, etc.
- {{BSrow-2}}, {{BS-2}}, {{BS2-2}}, {{BS3-2}}, etc.
The BSrow* templates are used to define the master format for its child templates. This is especially helpful for wiki of right-to-left writing system so editor only needs to modify the BSrow* template rather than the rest of the child row templates one by one.
A trial fix for the mobile view has been applied to all 3 BSrow* master templates in April 2012. However, on 17 April 2012 the mobile view has been presumably modified by the WMF and making the fix ineffective.
Legend
The "legend" in BS-map or BS-table which links to any of these pages:
- {{Railway line legend}} for generic railway map, the default legend.
- {{Railway track legend}} for railway track and platform alignment diagram.
- {{Bus route legend}} for any type of bus route map.
- {{Waterways legend}} for waterway or canal map.
- {{Trails legend}} for footpath map.
Although most legend pages use the template
namespace, you can apply other namespace like project
, help
or even no namespace (for general article if it is your personal Wiki) if you see fit, just remember to revise the legend link in the BS-map and BS-table.
If you find some of the term difficult to be translated into your home language, you can ring the code of the row by <!--
and -->
to hide it temporary until other editor helps the translation.
Optional template
- {{BSrow-replace}}, {{BS-replace}}, {{BS2-replace}}, {{BS3-replace}}, etc.: Replace the BSn-startCollapsible template with one of these templates in the map when the collapsed section expanded.
- {{Stnlnk}}, {{BSkm}}, {{BSsplit}}, {{BSsplit2}} & {{BSto}}: tailored text templates to display the text properly in the text cell of BS row templates.
- {{BS!}} for generating non-image color stripe with its height adjustable via parameter, primarily used by Russian and other Slavic metro maps.
- {{RoutemapRouteIcon}} & {{RoutemapRoute}} for display of arrow icons
in the text column.
- {{Railway line header (center)}}, {{Railway line header2}}, {{Railway line header2 (center)}}, variations of {{Railway line header}}.
- {{BS-daten}} and {{Infobox UK railway}}, infoboxes under {{Railway line header}}, may require translation.
- {{BS-table3}} & {{infobox rdt}} for transcluding map in other infobox.
- {{Rdt intro}} for adding description in map template page, may require translation.
- {{BSicon quote}} (bsq) for quoting the icon in the project, documentation or discussion pages.
- {{Colorbox}} for adding a colored square before the map title for indicating the livery color of the subject. According to WP:COLOR guideline, this is better than coloring the text or background of text for the sake of accessibility.
Major difference in other Wikimedia project
This section compares the major differences of other Wikimedia projects with English Wikipedia. If you have modified the RDT project in your home Wikimedia project, please kindly add or update the status in here.
Last update: 15 January 2012
Features
DE
EN
FR
HE
JA
KO
PT
RU
SH
SV
UK
ZH
{{Railway line header}},
{{BS-header}}, {{BS-table}}
Partial
Yes
Partial
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
{{BS-map}}
No
Yes
Partial
No
No
Partial
Yes
Yes
Yes
No
No
Yes
BSn row templates (basic)
Yes
Yes
Partial
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
BSn-startCollapsible row templates
No
Yes
No
No
Yes
No
Yes
Yes
No
No
No
Yes
BSn-2 row templates
No
Yes
No
No
Yes
Partial
Yes
Yes
No
Partial
Partial
Yes
Icon overlapping (available layers)[1]
No
5
4*
5
2*
1
5
5
5
No
1
5
Icon wikilink[1]
No
Yes
No
Yes
No
No
Yes
Yes*
Yes
No
Yes*
Yes
^1 Parameters of all kinds of BSn row templates.
DE - German Wikipedia
- {{Railway line header}} is not needed to define the standalone map table style.
- To translate the map of de:Vorlage:BSe to conventional BSn row templates, add the letter e before every icon name in the row template.
FR - French Wikipedia
- {{Railway line header}} and {{BS-header}} are merged into fr:Modèle:BS-table. This is somehow similar to {{BS-map}} but still requires the syntax,
{|
, for calling the table manually.
- BSn row templates employ a different set of icon names which we strongly discourage. Because it makes it difficult to adopt the maps from French Wikipedia to other Wiki. Also it requires a separate template (Modèle:LCF_[French icon name]) for every icon individually before using the icon in the BS row template.
- If you want to use the original icon name in French Wikipedia, use the BSnbis row templates instead (known as "Modèles internationaux"/"international template").
- BSnbis templates support 4-layer icon overlapping while the basic BSn row templates do not. You can overlap 2 icons over the base icon (O# and O#2) and two icons under the base icon (U# and U#2).
JA - Japanese Wikipedia
- Parameter name of second icon layer is P# instead of O#2.
KO - Korean Wikipedia
- {{Railway line header}}, {{BS-header}} and {{BS-table}} are merged into one single template, ko:틀:노선도, this is now adopted back to English Wikipedia as {{BS-map}} and its functionality is further expanded.
RU - Russian Wikipedia, UK - Ukrainian Wikipedia
- The parameter name of icon wikilink in row templates is link# instead of L#.
See also
- Meta:Help:Transwiki
- Mediawiki:Version, if you are running your own Wiki for a long time, your Wiki software might be outdated. Some Wiki syntax or parser used by this project are not available in the older versions.