Difference between revisions of "Template:LevelCrossing"

From All About Ayrshire
Jump to: navigation, search
 
(12 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
"description": "",
 
"description": "",
 
"params": {
 
"params": {
 +
"name": {
 +
"description": "The name of the crossing",
 +
"type": "string",
 +
"required": true
 +
},
 
"type": {
 
"type": {
 
"description": "This should be set as:\ntrain",
 
"description": "This should be set as:\ntrain",
Line 24: Line 29:
 
"required": true
 
"required": true
 
},
 
},
"name1": {
+
"roads": {
"description": "The name of the street the crossing is located",
+
"description": "The name of the road the crossing is located",
 
"type": "string",
 
"type": "string",
 
"required": true
 
"required": true
 
},
 
},
 
"crossingtype": {
 
"crossingtype": {
"description": "This is the type of crossing.\n\nAutomatic Barriers\nManually Controlled Gates\nManually Controlled Barriers\nAutomatic Half Barrier\nAutomatic Open Crossing\nOpen Crossing\nOther Types",
+
"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",
 
"type": "string",
 
"required": true
 
"required": true
Line 37: Line 42:
 
}
 
}
 
</templatedata>
 
</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]]
 
[[Category:Infoboxes]]
  
Line 50: Line 68:
 
--><table style="margin:6px;clear:right;" class="toc colour" align="right" width="267"><!--
 
--><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: {{{number|}}} | {{{number|}}} | {{PAGENAME}} }}'''<!--
+
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
 
Check to see if type is valid
Line 56: Line 74:
  
 
--></td></tr><!--
 
--></td></tr><!--
 
  
 
Location
 
Location
Line 74: Line 91:
  
 
RoadName
 
RoadName
-->{{#if: {{{name1|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Road Name'''</td></tr><tr><td colspan="2" align="center">
+
-->{{#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">
{{{name1}}}  
+
{{{roads}}}  
 
</td></tr>}}<!--
 
</td></tr>}}<!--
  
Line 87: Line 104:
  
  
-->
+
 
 +
 
 +
## Categories ##
 +
--><includeonly><!--
 +
 
 +
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}}}}}}}
 +
[[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