Difference between revisions of "Template:Routebox"

From All About Ayrshire
Jump to: navigation, search
Line 26: Line 26:
  
 
Start the table
 
Start the table
--><table style="margin:6px;clear:right;" class="toc colour" align="right" width="267"><!--
+
--><table style="margin:6px;clear:right;" border: 4px;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: {{{number|}}} | {{{number|}}} | {{PAGENAME}} }}'''<!--
Line 34: Line 34:
  
 
--></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"></display_map>
 
 
 
--> {{#ifexist: {{#var:theimagename}} | | {{#if: {{{sabremap|}}} |<tr><td colspan="2" align="center" width="250px">
 
{{{googlemap}}} [[Category:Pages with 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
Line 108: Line 89:
  
 
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 154: Line 135:
 
{{{location}}}  
 
{{{location}}}  
 
</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>}}<!--
 +
  
  
Line 209: Line 196:
 
-->{{#if: {{{gridrefs|}}} | [[Category:Articles using the gridrefs parameter]] }} <!--
 
-->{{#if: {{{gridrefs|}}} | [[Category:Articles using the gridrefs parameter]] }} <!--
 
-->{{#if: {{{county|}}} || [[Category:Articles without county information]] }} <!--
 
-->{{#if: {{{county|}}} || [[Category:Articles without county information]] }} <!--
 +
-->{{#if: {{{location|}}} | Hunterston | [[Category:Hunterston]]}}<!--
 
-->{{#if: {{{authority|}}} || {{#ifeq: {{{former}}} | no | [[Category:Articles without authority information]] }} }} <!--
 
-->{{#if: {{{authority|}}} || {{#ifeq: {{{former}}} | no | [[Category:Articles without authority information]] }} }} <!--
 
-->{{#if: {{{miles|{{{km|}}}}}} || [[Category:Articles without distance information]] }} <!--
 
-->{{#if: {{{miles|{{{km|}}}}}} || [[Category:Articles without distance information]] }} <!--

Revision as of 20:17, 7 October 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}}}