Module:Road data/strings/doc: Difference between revisions

Content deleted Content added
rearrange
Undid revision 1271553142 by Ahecht (talk)
 
(18 intermediate revisions by 6 users not shown)
Line 1:
This module is used to store type data for use with several road templates, including {{tl|jct}} and {{tl|routelist row}}.
Background information and a summary of the syntax are listed below.
<includeonly>{{#ifeq:{{FULLPAGENAME}}|Module:Road data/strings|<p>{{Clickable button|Special:Search/-intitle:"/doc" -intitle:"/sandbox" -intitle:"/testcases" -intitle:"/styles.css" prefix:Module:Road data/strings/|View regional modules}}</p>|==Exported types==
 
This module exports the following types:
{{Module exports|exclude=^%s}}}}</includeonly><noinclude><br><br>[BUTTON OR EXPORTS ARE ADDED HERE]</noinclude>
==Syntax==
===Hierarchy and fields===
Line 20 ⟶ 23:
*<code>abbr</code> determines the displayed abbreviation.
 
Other common fields in road data tables
====Other types====
*<code>shieldmain</code> is used when a different shield is desired at the top of an infobox, such as for county roads.
 
Line 38 ⟶ 41:
 
*<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.; Commoncommon 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>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>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 referred toreferenced 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">