Difference between revisions of "Template:LevelCrossing"

From All About Ayrshire
Jump to: navigation, search
 
(18 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
| 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>
 
 
 
 
 
 
<noinclude>{{High use}}
 
<div style="border: 2px solid black; background-color:wheat; margin:4px;padding:4px;">
 
'''<big>Documentation: {{BASEPAGENAME}}</big>'''
 
 
 
The Routebox is the big template down the right hand side of every single roads page on the Wiki.
 
 
 
Do not edit this template unnecessarily as it is included in about 6,000 pages. This causes issues regarding the Job Queue, after an update it takes 6,000 page views to clear the job queue. If edited twice, that number doubles to 12,000 (etc..) Smaller updates to other templates then need to wait for the job queue to clear before they take full effect, which can cause problems for other editors.
 
 
 
Test all edits on [[Template:Routebox Sandbox]] first (the sandbox template is included in [[A449 Sandbox]])
 
 
 
To use this template, copy the code below, replacing anything within <tags> as appropriate.
 
<div style="border: 1px dashed black; background-color:white; margin:2px;padding:4px;font-family:Courier,system;">
 
<nowiki>{{Routebox | <lots> }}</nowiki>
 
</div>
 
'''<lots>''' - There are literally hundreds of different options available.  See the [[Help:Routeboxes]] page for details of how to use this template.<br/>
 
</div>
 
 
 
 
[[Category:Infoboxes]]
 
[[Category:Infoboxes]]
  
Line 43: 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 49: Line 74:
  
 
--></td></tr><!--
 
--></td></tr><!--
 
  
 
Location
 
Location
Line 67: Line 91:
  
 
RoadName
 
RoadName
-->{{#if: {{{name|}}} |<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">
{{{name}}}  
+
{{{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>}}<!--
 
</td></tr>}}<!--
  
Line 75: 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