Difference between revisions of "Template:Crossing"

From All About Ayrshire
Jump to: navigation, search
(Created page with "<noinclude>{{High use}}<div style="border: 2px solid black; background-color:wheat; margin:4px;padding:4px;"> '''<big>Documentation: {{BASEPAGENAME}}</big>''' The Infobox is...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{High use}}<div style="border: 2px solid black; background-color:wheat; margin:4px;padding:4px;">
+
<table style="margin:6px;clear:right;" class="toc colour" align="right" width="267"><!--
'''<big>Documentation: {{BASEPAGENAME}}</big>'''
 
  
The Infobox is the big template down the right hand side of every single page on the Wiki, other than those that relate to a road.  This template calls the main '''[[:Template:Infobox|&#123;&#123;Infobox&#125;&#125;]]''', and passes parameters to it that are relevant to crossings, including bridges, tunnels, ferries and causeways .  It also places the page within the [[:Category:All Crossings|All Crossings category]], and if the "type" parameter is set to "ferry", it will add the page to the [[:Category:Ferries|Ferries category]]
+
Name--><tr><td style="background:{{Get bg colour|{{{type|ferry}}} }}; border:1px solid #000000; color:{{Get road text colour|{{{type|ferry}}} }}; font-size:14pt; padding:4px; font-weight: bold;" align=center colspan="2">'''{{#if: {{{name|}}} | {{{name|}}} | {{PAGENAME}} }}'''<!--
  
Do not edit this template unnecessarily as it is included in every crossing page. This causes issues regarding the Job Queue, after an update it takes hundreds of page views to clear the job queue. If edited twice, that number doubles (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.
+
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 | ferry | eurovelo = | #default = <br/><span style="font-size:8pt"><span style="color:red;">'''Error:'''</span> Invalid type specified</span><includeonly>[[Category:Pages with errors]]</includeonly> }} <!--
  
Test all edits on [[Template:Crossing sandbox]] first.
+
--></td></tr><!--
  
To use this template, copy the code below, replacing anything within <tags> as appropriate.  Note that these are only the most common tags, others are also available.
 
<div style="border: 1px dashed black; background-color:white; margin:2px;padding:4px;font-family:Courier,system;">
 
<nowiki>{{</nowiki>{{BASEPAGENAME}}<br/><nowiki>
 
| name              = <name></nowiki><br/><nowiki>
 
| welsh              = <welsh></nowiki><br/><nowiki>
 
| irish              = <irish></nowiki><br/><nowiki>
 
| gaelic            = <gaelic></nowiki><br/><nowiki>
 
| from              = <from></nowiki><br/><nowiki>
 
| to                = <to></nowiki><br/><nowiki>
 
| county            = <county></nowiki><br/><nowiki>
 
| image              = <image></nowiki><br/><nowiki>
 
| caption            = <caption></nowiki><br/><nowiki>
 
| lat                = <lat></nowiki><br/><nowiki>
 
| lon                = <lon></nowiki><br/><nowiki>
 
| zoom              = <zoom></nowiki><br/><nowiki>
 
| layer              = <layer></nowiki><br/><nowiki>
 
| static            = <static></nowiki><br/><nowiki>
 
| number            = <number></nowiki><br/><nowiki>
 
| type              = <type></nowiki><br/><nowiki>
 
| operator          = <operator></nowiki><br/><nowiki>
 
| authority          = <authority></nowiki><br/><nowiki>
 
| toll              = <toll></nowiki><br/><nowiki>
 
| open              = <open></nowiki><br/><nowiki>
 
| offical_open      = <official_open></nowiki><br/><nowiki>
 
| closed            = <closed></nowiki><br/><nowiki>
 
| cost              = <cost></nowiki><br/><nowiki>
 
| rel1              = <rel1></nowiki><br/><nowiki>
 
| rel2              = <rel2></nowiki><br/><nowiki>
 
| rel3              = <rel3></nowiki><br/><nowiki>
 
| rel4              = <rel4></nowiki><br/><nowiki>
 
| rel5              = <rel5></nowiki><br/><nowiki> }}</nowiki>
 
</div>
 
'''<name>''' - The primary English name of the crossing.  For crossings in Wales where the Welsh name is primarily used, put it here.<br/>
 
'''<welsh>''' - The Welsh name of the crossing, if different.<br/>
 
'''<irish>''' - The Irish name of the crossing, if different.<br/>
 
'''<gaelic>''' - The Gaelic name of the crossing, if different.<br/>
 
'''<from>''' - Location of one side of the crossing.<br/>
 
'''<to>''' - Location of the opposite side of the crossing.<br/>
 
'''<county>''' - The Historic (or Traditional) County that the crossing is located within.<br/>
 
'''<image>''' - A suitable picture for diplaying to illustrate the crossing.<br/>
 
'''<nowiki><caption></nowiki>''' - The caption for the above image, if needed.<br/>
 
'''<lat>''' - The latitude of the crossing.  Needed to display a map.<br/>
 
'''<lon>''' - The longitude of the crossing.  Needed to display a map.<br/>
 
'''<zoom>''' - The zoom level of a displayed map.<br/>
 
'''<static>''' - Forces a map to display in static mode, so removes the ability to scroll or zoom. Must be equal to ''true'' if desired.<br/>
 
'''<layer>''' - The Maps layer displayed in this Infobox.  Defaults to OpenStreetMap if not used.<br/>
 
'''<type>''' - The type of the road that uses the crossing.  Should be set to "primary", "non primary", "defunct" or "ferry", depending on the type of crossing.<br/>
 
'''<open>''' - The opening date of the crossing.<br/>
 
'''<official_open>''' - The official opening date of the crossing, usually marked by a ceremony.  Only use if different from ''open''.<br/>
 
'''<closed>''' - The closure date of the crossing, if relevant.  Should be used with a ''type'' of "defunct"<br/>
 
'''<number>''' - The road number(s) that use a crossing.<br/>
 
'''<operator>''' - The operator of the crossing, if not a Highway or Road Authority.<br/>
 
'''<authority>''' - The Highway or Road Authority managing the crossing, if a local or national authority.<br/>
 
'''<toll>''' - The toll or price of crossing, if appropriate.<br/>
 
'''<cost>''' - The cost of building the crossing.<br/>
 
</div>[[Category:Infoboxes using the main Infobox template]]</noinclude><!--
 
  
  
-->{{Infobox
 
<!-- Set up names and colours -->
 
| type              = {{{type|non primary}}}
 
| name              = {{{name|}}}
 
| welsh              = {{{welsh|}}}
 
| irish              = {{{irish|}}}
 
| gaelic            = {{{gaelic|}}}
 
| country            = {{{country|}}}
 
<!-- Set up location items -->
 
| region            = {{{region|}}}
 
| county            = {{{county|}}}
 
| traditional_county = {{{traditional_county|}}}<!-- This parameter is obsolete and only provided for compatibility-->
 
| location          = {{{location|}}}
 
| ceremonial_county  = {{{ceremonial_county|}}}<!-- This parameter is obsolete and only provided for compatibility-->
 
| authority          = {{{authority|}}}
 
| from              = {{{from|}}}
 
| to                = {{{to|}}}
 
<!-- Set up infobox picture and gallery -->
 
| gallery            = {{{gallery|{{PAGENAME}}}}}
 
| image              = {{{image|}}}
 
| caption            = {{{caption|}}}
 
<!-- Set up map parameters.  Default zoom to 14, and force map to appear at bottom of Infobox  -->
 
| lat                = {{{lat|}}}
 
| lng                = {{{lng|}}}<!-- This parameter is obsolete and only provided for compatibility-->
 
| lon                = {{{lon|}}}
 
| zoom              = {{{zoom|14}}}
 
| layer              = {{{layer|}}}
 
| height            = {{{height|}}}
 
| static            = {{{static|}}}
 
| trace              = {{{trace|}}}
 
| maploc            = top
 
<!-- Set up items related specifically to being a generic crossing-->
 
| road              = {{{road|}}}
 
| number            = {{{number|}}}<!-- This parameter is obsolete and only provided for compatibility-->
 
| start_date        = {{{start|}}}
 
| open              = {{{open|}}}
 
| official_open      = {{{official_open|}}}
 
| built              = {{{built|}}}<!-- This parameter is obsolete and only provided for compatibility-->
 
| operator          = {{{operator|}}}
 
| toll              = {{{toll|}}}
 
| contractor        = {{{contractor|}}}
 
| cost              = {{{cost|}}}
 
| contype            = {{{contype|}}}
 
<!-- Related items -->
 
| relcat            = All Crossings
 
| relname            = Crossings
 
| rel1              = {{{rel1|}}}
 
| rel2              = {{{rel2|}}}
 
| rel3              = {{{rel3|}}}
 
| rel4              = {{{rel4|}}}
 
| rel5              = {{{rel5|}}}
 
}}<!--
 
  
## Categories ##
+
From
--><includeonly><!--
+
--><tr><td align="right" width="{{#if: {{{formernumbers|{{{nowpartof|}}}}}} |85|65}}">'''From:{{nb1}}'''</td><td align=left>{{{from}}} {{#if: {{{gridref_from|}}} | <small>([{{#var: grfrom }} {{{gridref_from|}}}])</small>}}</td></tr><!--
  
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.
+
To
-->{{DEFAULTSORT:{{{name|{{PAGENAME}}}}}}}
+
--><tr><td align="right">'''To:{{nb1}}'''</td><td align="left">{{{to}}} {{#if: {{{gridref_to|}}} | <small>([{{#var: grto }} {{{gridref_to|}}}])</small>}}</td></tr><!--
[[Category:All Crossings]]
 
  
<!-- If type is set to "ferry", add to "Ferries" category -->
+
Via
{{#ifeq: {{{type|}}}| ferry | [[Category:Ferries]]}}</includeonly>
+
-->{{#if: {{{via|}}} | <tr><td align="right">'''Via:'''</td><td align="left">{{{via}}}</td></tr> }}<!--
 +
 
 +
Meets - First checks whether route is defunct, then chooses to display "met" or "meets" in the infobox.  Also deals with displaying "metyear" parameter if included and appropriate.
 +
 
 +
-->{{#vardefine: former | {{#switch: {{{type|}}}
 +
| defunct            = yes
 +
| former motorway    = yes
 +
| unbuilt motorway    = yes
 +
| roman              = yes
 +
| historic            = yes
 +
| unbuilt non primary = yes
 +
| unbuilt primary    = yes
 +
| #default            = no
 +
}} }}<!--
 +
 
 +
 
 +
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>}}<!--
 +
 
 +
Length
 +
-->{{#if: {{{miles|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Distance of Travel'''</td></tr><tr><td colspan="2" align="center">{{#expr:{{{miles}}} round 1}} miles ({{#expr: ({{{miles}}} * 1.6093) round 1 }} km)
 +
</td></tr>}}<!--
 +
 
 +
Time
 +
-->{{#if: {{{time|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Time of Travel'''</td></tr><tr><td colspan="2" align="center">
 +
{{{time}}}
 +
</td></tr>}}<!--
 +
 
 +
Meets
 +
-->{{#if: {{{meets|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Meets'''</td></tr><tr><td colspan="2" align="center">
 +
{{{meets}}}
 +
</td></tr>}}<!--
 +
 
 +
Operator
 +
-->{{#if: {{{operator|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Operator'''</td></tr><tr><td colspan="2" align="center">
 +
{{{operator}}}
 +
</td></tr>}}<!--
 +
 
 +
Cost
 +
-->{{#if: {{{toll|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Cost'''</td></tr><tr><td colspan="2" align="center">
 +
{{{toll}}}  
 +
</td></tr>}}<!--
 +
 
 +
 
 +
--></table><!--

Latest revision as of 15:15, 13 October 2015

Crossing
From:-{{{from}}}
To:-{{{to}}}