Difference between revisions of "Template:LevelCrossing"

From All About Ayrshire
Jump to: navigation, search
(Created page with "-->{{Infobox <!-- Set up names and colours --> | type = {{{type|train}}} | name = {{{name|}}} | country = {{{country|}}} | county...")
 
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
-->{{Infobox
+
<noinclude>
<!-- Set up names and colours -->
+
<templatedata>
| type               = {{{type|train}}}
+
{
| name              = {{{name|}}}
+
"description": "",
| country            = {{{country|}}}
+
"params": {
  | county            = {{{county|}}}
+
"name": {
| location          = {{{location|}}}
+
"description": "The name of the crossing",
| road              = {{{road|}}}
+
"type": "string",
| operator          = {{{operator|}}}
+
"required": true
<!-- Related items -->
+
},
| relcat            = All Crossings
+
"type": {
}}<!--
+
"description": "This should be set as:\ntrain",
 +
"type": "string",
 +
"required": true
 +
},
 +
"location": {
 +
"description": "The location it is located, this is the local town, village or suburb of city",
 +
"type": "string",
 +
"required": true
 +
},
 +
"country": {
 +
"description": "The Country it is located in",
 +
"type": "string",
 +
"required": true
 +
},
 +
"county": {
 +
"description": "The name of the County",
 +
"type": "string",
 +
"required": true
 +
},
 +
"roads": {
 +
"description": "The name of the road the crossing is located",
 +
"type": "string",
 +
"required": true
 +
},
 +
"crossingtype": {
 +
"description": "This is the type of crossing.\n\nAutomatic Barriers\n\nManually Controlled Gates\n\nManually Controlled Barriers\n\nAutomatic Half Barrier\n\nAutomatic Open Crossing\n\nOpen Crossing\n\nOther Types",
 +
"type": "string",
 +
"required": true
 +
}
 +
}
 +
}
 +
</templatedata>
 +
<b>Example:</b><br />
 +
The code for the map is added after the crossing type.
 +
<pre>
 +
{{LevelCrossing
 +
| name              = Ardrossan Level Crossing
 +
| type              = train
 +
| country            = Scotland
 +
| county            = North Ayrshire
 +
| location          = Ardrossan
 +
| roads              = Princes Street
 +
| crossingtype      = Automatic Barriers
 +
{{#display_map: 55.63950883290983,-4.812919646501541|mappingservice=leaflet|zoom=15}}
 +
}}
 +
</pre>
 +
[[Category:Infoboxes]]
 +
 
 +
 
 +
</noinclude><!-- The following lines define the colours associated with the different types of road.
 +
 
 +
When adding new types, ensure that the type is also added to the block of code below the number section.
 +
 
 +
<!--
 +
 
 +
Start the table
 +
--><table style="margin:6px;clear:right;" class="toc colour" align="right" width="267"><!--
 +
 
 +
Number--><tr><td style="background:{{Get bg colour|{{{type|non primary}}} }}; border:1px solid #000000; color:{{Get road text colour|{{{type|non primary}}} }}; font-size:14pt; padding:4px; font-weight: bold;" align=center colspan="2">'''{{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}} }}'''<!--
 +
 
 +
Check to see if type is valid
 +
-->{{#switch: {{{type|non primary}}} | primary | non primary | motorway  | defunct  | unbuilt motorway | former motorway  | future motorway  | future primary  | unbuilt primary  | future non primary | unbuilt non primary | historical | roman | tourist | euroroute | e road | ncn | cycle route | private | train | eurovelo = | #default = <br/><span style="font-size:8pt"><span style="color:red;">'''Error:'''</span> Invalid type specified</span><includeonly>[[Category:Pages with errors]]</includeonly> }} <!--
 +
 
 +
--></td></tr><!--
 +
 
 +
Location
 +
-->{{#if: {{{location|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Location'''</td></tr><tr><td colspan="2" align="center">
 +
{{{location}}}
 +
</td></tr>}}<!--
 +
 
 +
Country
 +
-->{{#if: {{{country|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Country'''</td></tr><tr><td colspan="2" align="center">
 +
{{{country}}}  
 +
</td></tr>}}<!--
 +
 
 +
County
 +
-->{{#if: {{{county|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''County'''</td></tr><tr><td colspan="2" align="center">
 +
{{{county}}}
 +
</td></tr>}}<!--
 +
 
 +
RoadName
 +
-->{{#if: {{{roads|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Road Name'''</td></tr><tr><td colspan="2" align="center">
 +
{{{roads}}}  
 +
</td></tr>}}<!--
 +
 
 +
Crossing Type
 +
-->{{#if: {{{crossingtype|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Crossing Type'''</td></tr><tr><td colspan="2" align="center">
 +
{{{crossingtype}}}
 +
</td></tr>}}<!--
 +
 
 +
 
 +
--></table><!--
 +
 
 +
 
 +
 
  
 
## Categories ##
 
## Categories ##
Line 17: Line 111:
 
Categorise in the main "All Crossings" category.  They will be sorted by the name given in then "name" parameter, unless that is not used, in which case it uses the page name.
 
Categorise in the main "All Crossings" category.  They will be sorted by the name given in then "name" parameter, unless that is not used, in which case it uses the page name.
 
-->{{DEFAULTSORT:{{{name|{{PAGENAME}}}}}}}
 
-->{{DEFAULTSORT:{{{name|{{PAGENAME}}}}}}}
[[Category:LevelCrossings]]</includeonly>
+
[[Category:All Crossings]]
 +
 
 +
<!-- If type is set to "train", add to "Level Crossing" category -->
 +
{{#ifeq: {{{type|}}}| train | [[Category:Level Crossings]]}}</includeonly>

Latest revision as of 14:33, 13 October 2015

<templatedata> { "description": "", "params": { "name": { "description": "The name of the crossing", "type": "string", "required": true }, "type": { "description": "This should be set as:\ntrain", "type": "string", "required": true }, "location": { "description": "The location it is located, this is the local town, village or suburb of city", "type": "string", "required": true }, "country": { "description": "The Country it is located in", "type": "string", "required": true }, "county": { "description": "The name of the County", "type": "string", "required": true }, "roads": { "description": "The name of the road the crossing is located", "type": "string", "required": true }, "crossingtype": { "description": "This is the type of crossing.\n\nAutomatic Barriers\n\nManually Controlled Gates\n\nManually Controlled Barriers\n\nAutomatic Half Barrier\n\nAutomatic Open Crossing\n\nOpen Crossing\n\nOther Types", "type": "string", "required": true } } } </templatedata> Example:
The code for the map is added after the crossing type.

{{LevelCrossing 
 | name               = Ardrossan Level Crossing
 | type               = train
 | country            = Scotland
 | county             = North Ayrshire
 | location           = Ardrossan
 | roads              = Princes Street
 | crossingtype       = Automatic Barriers
{{#display_map: 55.63950883290983,-4.812919646501541|mappingservice=leaflet|zoom=15}}
}}


LevelCrossing