Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
BRUS Wikipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Road data/strings/doc
(section)
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Get shortened URL
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Hierarchy and fields=== At its most basic level, this module is a nested table of strings. At the top is the root table, named for the abbreviation of a country, state, or province. This table stores the type data for a particular place, which is named in the comment in the first line, and is returned at the end of the module. The table is composed of further tables, one per type. The basic syntax for a type table is: <syntaxhighlight lang="lua"> place.type = { shield = "", name = "", link = "", abbr = "" } </syntaxhighlight> The four main fields in a type table are <code>shield</code>, <code>name</code>, <code>link</code>, and <code>abbr</code>. Currently, these are the types used by all countries. By convention, they are always specified, using an empty string <code>"",</code> if there is no value. *<code>shield</code> determines the shield that is displayed, if any *<code>name</code> specifies the name of the route displayed by an infobox *<code>link</code> specifies the target of a link generated, if any *<code>abbr</code> determines the displayed abbreviation. Other common fields in road data tables *<code>shieldmain</code> is used when a different shield is desired at the top of an infobox, such as for county roads. <syntaxhighlight lang="lua"> USA.CR = { shield = "CR %route% jct.svg", shieldmain = "[county||%county% |]County %route%.svg", name = "County Road %route%", link = "", abbr = "CR %route%" } </syntaxhighlight> *<code>shieldlist</code> is used when a different shield is desired in lists that utilize the {{tl|Routelist row}} series of templates. *<code>base</code> can be used for aliasing different types that have a similar base structure, such as U.S. Highway special routes. *<code>banner</code> stores the name of the special route plate, such as <code>[[:File:Business plate.svg|Business plate.svg]]</code>. Can be omitted when unused. *<code>width</code> stores a code representing the width of the shield. It is most often helpful when used with <code>banner</code>. Can be omitted entirely when unused; common values are <code>square</code> and <code>expand</code>. *<code>section</code> stores the specific section number for those routes that are defined by law. *<code>translation</code> specifies the native language name of the route displayed by an infobox *<code>lang</code> is the [[List of ISO 639-2 codes|ISO 639-2]] code of the native language; this code is used by {{tl|Lang}} and [[Template:Lang#Language-specific templates|Lang-<i>xx</i> templates]]. <syntaxhighlight lang="lua"> PER.RN = { shield = "PE-%route% route sign.svg", name = "National Route %route%", link = "Peru Highway %route%", abbr = "PE-%route%", translation = "Ruta nacional %route%", lang = "es-pe" } </syntaxhighlight> Once a type is defined, it can be referenced later in the code. As seen here, it is common to define all parameters for main types like <code>US</code> and then to use aliases for subtypes such as <code>US-Alt</code>. <syntaxhighlight lang="lua"> MO.US = { shield = "US %route%.svg", base = "U.S. Route %route%", link = "U.S. Route %route% in Missouri", abbr = "US %route%", width = "expand" } MO["US-Alt"] = { shield = MO.US.shield, link = MO.US.base .. " Alternate ([dab||%dab%, |]Missouri)", abbr = MO.US.abbr .. " Alt.", banner = "Alternate plate.svg", width = "expand" } </syntaxhighlight>
Summary:
Please note that all contributions to BRUS Wikipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BRUS Wikipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template