Difference between revisions of "Template:Routebox"

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 Routebox i...")
 
 
(12 intermediate revisions by the same user not shown)
Line 31: Line 31:
  
 
Check to see if type is valid
 
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 | eurovelo = | #default = <br/><span style="font-size:8pt"><span style="color:red;">'''Error:'''</span> Invalid type specified</span><includeonly>[[Category:Pages with errors]]</includeonly> }} <!--
+
-->{{#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 | 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><!--
 
--></td></tr><!--
 
Define the name of the map, if "mapname" exists, use that, otherwise default to "PAGENAME".png
 
-->{{#vardefine:theimagename| {{#if: {{{mapname|}}} | Image:{{{mapname}}} |  Image:{{PAGENAME}}.png }} }}<!--
 
 
Add Map extract if map file does not exist
 
<display_map service="openlayers">{{lat}},{{lng}}</display_map>
 
 
 
--> {{#ifexist: {{#var:theimagename}} | | {{#if: {{{sabremap|}}} |<tr><td colspan="2" align="center" width="250px">
 
{{{sabremap}}} [[Category:Pages with SABRE Maps routeboxes]]
 
</td></tr> | [[Category:Needs Map]] }} }}<!--
 
 
If the map exists, use it, if not, categorise as requiring a map.
 
-->{{#ifexist: {{#var:theimagename}} |<tr><td align=center colspan="2">[[{{#var:theimagename}}|250px]]</td></tr>  }}<!--
 
 
Map Caption
 
-->{{#if: {{{mapcaption|}}} | <tr><td align="center" colspan="2">{{{mapcaption}}}</td></tr>}}<!--
 
 
 
  
 
Name
 
Name
 
-->{{#if: {{{name|}}} | <tr><td align="center" colspan="2">'''{{{name}}}'''</td></tr>}}<!--
 
-->{{#if: {{{name|}}} | <tr><td align="center" colspan="2">'''{{{name}}}'''</td></tr>}}<!--
  
Build gridref links
 
 
-->{{#vardefine: grfrom | {{#switch: {{{country|Great Britain}}}
 
| Northern Ireland
 
| northern ireland
 
| Northern ireland
 
| northern Ireland
 
| NI
 
| ni
 
| Ni
 
| Republic of Ireland
 
| republic of ireland
 
| Republic Of Ireland
 
| Republic of ireland
 
| ROI
 
| Roi
 
| RoI
 
| roi
 
| Ireland
 
| ireland =
 
| #default =
 
}} }}<!--
 
 
-->{{#vardefine: grto | {{#switch: {{{country|Great Britain}}}
 
| Northern Ireland
 
| northern ireland
 
| Northern ireland
 
| northern Ireland
 
| NI
 
| ni
 
| Ni
 
| Republic of Ireland
 
| republic of ireland
 
| Republic Of Ireland
 
| Republic of ireland
 
| ROI
 
| Roi
 
| RoI
 
| roi
 
| Ireland
 
| ireland =
 
| #default =
 
}} }}<!--
 
  
 
From
 
From
Line 108: Line 46:
  
 
Via
 
Via
-->{{#if: {{{via|}}} | <tr><td align="right">'''Via:'''</td><td align="left">{{{via}}}</td></tr> }}<!--
+
-->{{#if: {{{via|}}} | <tr><td align="right">'''Via:{{nb1}}'''</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.
 
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.
Line 147: Line 85:
 
}}<!--
 
}}<!--
  
Grid Refs
 
-->{{#if: {{{gridrefs|}}} | <tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Grid References'''</td></tr><tr><td colspan="2" align="center">{{{gridrefs}}}</td></tr>}}<!--
 
  
 
Location
 
Location
Line 155: Line 91:
 
</td></tr>}}<!--
 
</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>}}<!--
  
 
Length
 
Length
Line 171: Line 111:
  
 
Authority
 
Authority
-->{{#if: {{{authority|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Highway Authorities'''</td></tr><tr><td colspan="2" align="center">
+
-->{{#if: {{{authority|}}} |<tr><td style="background:#ffcc00; border:1px solid #2E0854" colspan="4" align="center">'''Highway Authority'''</td></tr><tr><td colspan="2" align="center">
 
{{{authority}}}  
 
{{{authority}}}  
 
</td></tr>}}<!--
 
</td></tr>}}<!--
Line 206: Line 146:
 
-->{{#ifeq: {{{type|}}} | cycle route | [[Category:Cycle Routes]]}}<!--
 
-->{{#ifeq: {{{type|}}} | cycle route | [[Category:Cycle Routes]]}}<!--
 
-->{{#ifeq: {{{type|}}} | eurovelo | [[Category:EuroVelo]] [[Category:Cycle Routes]]}}<!--
 
-->{{#ifeq: {{{type|}}} | eurovelo | [[Category:EuroVelo]] [[Category:Cycle Routes]]}}<!--
-->{{#if: {{{gridrefs|{{{gridref_from|{{{gridref_to|}}}}}}}}}|| [[Category:Articles without grid references]] }} <!--
 
-->{{#if: {{{gridrefs|}}} | [[Category:Articles using the gridrefs parameter]] }} <!--
 
 
-->{{#if: {{{county|}}} || [[Category:Articles without county information]] }} <!--
 
-->{{#if: {{{county|}}} || [[Category:Articles without county information]] }} <!--
 
-->{{#if: {{{authority|}}} || {{#ifeq: {{{former}}} | no | [[Category:Articles without authority information]] }} }} <!--
 
-->{{#if: {{{authority|}}} || {{#ifeq: {{{former}}} | no | [[Category:Articles without authority information]] }} }} <!--

Latest revision as of 02:42, 9 November 2015

Documentation: Routebox

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.

{{Routebox | <lots> }}

<lots> - There are literally hundreds of different options available. See the Help:Routeboxes page for details of how to use this template.


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