Difference between revisions of "Template:Infobox"

From All About Ayrshire
Jump to: navigation, search
Line 49: Line 49:
 
--></td></tr><tr><td></td></tr><!--
 
--></td></tr><tr><td></td></tr><!--
  
Add a map at the top of the infobox, if the "maploc" tag is used with the value of "top", or not used at all.  "Maploc" is usually defined within the template that calls this one.
 
If "sabremap" tag is used, use that specifically; if no sabremap tag exists, build a map from Maps using various tags!  Allows for most Maps tags, and allows for the alternate, deprecated use of the "lng" tag instead of the more common "lon" for the longitude of the centre point.  Uses "mapzoom" variable to set a default zoom level when one is not specified.  Uses "longitude" variable to account for the use of both "lon" and "lng" tags.
 
-->{{#if: {{{zoom|}}}|{{#vardefine:mapzoom|{{{zoom}}} }}|{{#vardefine:mapzoom|13}} }}<!--
 
-->{{#if: {{{lon|}}}|{{#vardefine:longitude|{{{lon}}} }} }}<!--
 
-->{{#if: {{{lng|}}}|{{#vardefine:longitude|{{{lng}}} }} }}<!--
 
  
-->{{#ifeq: {{{maploc|top}}} | top |
+
Image and caption. The image width is defined by the width of the map, if there is no map, or the mapwidth is not given, it will default to 250px
      {{#if: {{{sabremap|}}} 
+
-->{{#if: {{{image|}}}         | <tr><td colspan="2">[[Image:{{{image}}}|{{{mapwidth|250}}}px]]</td></tr>|<includeonly></includeonly>}}<!--
            | <tr><td style="background:#eee; border-bottom:1px solid #888" colspan="2" align="center">[http://www.sabre-roads.org.uk/maps/index.php?view={{{lat|}}},{{#var:longitude}}&markers={{{lat|}}},{{#var:longitude}}&map=OSMMap&zoom=10&layer=0 '''Location Map''']</td></tr><tr><td style="background:#eee; border:0px solid #AFA3BF" colspan="2" align="center"> {{{sabremap}}} </td></tr><tr><td></td></tr><tr><td></td></tr>
 
            | {{#if: {{{lat|}}}  
 
                  | {{#if: {{#varexists:longitude}}
 
                          | <tr><td style="background:#eee; border-bottom:1px solid #888" colspan="2" align="center">[http://www.sabre-roads.org.uk/maps/index.php?view={{{lat|}}},{{#var:longitude}}&markers={{{lat|}}},{{#var:longitude}}&map=OSMMap&zoom=10&layer=0 '''Location Map''']</td></tr><tr><td style="background:#eee; border:0px solid #AFA3BF" colspan="2" align="center"><sabremap lat={{{lat}}} lon={{#var:longitude}} zoom={{#var:mapzoom}} width=250 height={{{height}}}
 
                          {{#if: {{{layer|}}} | layer={{{layer}}} | }}
 
                          {{#if: {{{trace|}}} | trace={{{trace}}} | }}
 
                          {{#if: {{{static|}}} | static={{{static}}} | }}
 
                          /></td></tr><tr><td></td></tr><tr><td></td></tr>
 
                    }}
 
              }}
 
        }}
 
  }}<!--
 
  
Image and caption. The image width is defined by the width of the map, if there is no map, or the mapwidth is not given, it will default to 250px
 
-->{{#if: {{{image|}}}        | <tr><td colspan="2">[[Image:{{{image}}}|{{{mapwidth|250}}}px]]</td></tr>|<includeonly>[[Category:Needs Image]]</includeonly>}}<!--
 
-->{{#if: {{{caption|}}}      | <tr><td colspan="2" style="text-align:center;"><small>''{{{caption}}}''</small> }}<!--
 
  
Gallery icon and link to page's photo gallery
 
--><tr><td colspan="2" align="center">
 
{| width="100%" style="background-color:#F9F9F9;"
 
|style="padding-right:4px"|[[Image:Cameraicon.png|40px]]
 
|style="padding-left:4px;text-align:center;"|{{Get Pictures |
 
 
                                                     {{{gallery| {{PAGENAME}} }}}
 
                                                     {{{gallery| {{PAGENAME}} }}}
 
                                             }}
 
                                             }}
Line 204: Line 179:
  
  
Add a map at this point of the infobox, if the "maploc" tag is used with the value of "bottom".  "Maploc" is usually defined within the template that calls this one.
 
If "sabremap" tag is used, use that specifically; if no sabremap tag exists, build a map from SABRE Maps using various tags!  Uses the various variables defined on the earlier map section for zoom levels and longitude.
 
-->{{#if: {{{zoom|}}}|{{#vardefine:mapzoom|{{{zoom}}} }}|{{#vardefine:mapzoom|13}} }}<!--
 
-->{{#if: {{{lon|}}}|{{#vardefine:longitude|{{{lon}}} }} }}<!--
 
-->{{#if: {{{lng|}}}|{{#vardefine:longitude|{{{lng}}} }} }}<!--
 
 
-->{{#ifeq: {{{maploc|}}} | bottom |
 
      {{#if: {{{sabremap|}}} 
 
            | <tr><td style="background:#eee; border-bottom:1px solid #888" colspan="2" align="center">[http://www.sabre-roads.org.uk/maps/index.php?view={{{lat|}}},{{#var:longitude}}&markers={{{lat|}}},{{#var:longitude}}&map=OSMMap&zoom=10&layer=0 '''Location Map''']</td></tr><tr><td style="background:#eee; border:0px solid #AFA3BF" colspan="2" align="center"> {{{sabremap}}} </td></tr><tr><td></td></tr><tr><td></td></tr>
 
            | {{#if: {{{lat|}}}
 
                  | {{#if: {{#varexists:longitude}}
 
                          | <tr><td style="background:#eee; border-bottom:1px solid #888" colspan="2" align="center">[http://www.sabre-roads.org.uk/maps/index.php?view={{{lat|}}},{{#var:longitude}}&markers={{{lat|}}},{{#var:longitude}}&map=OSMMap&zoom=10&layer=0 '''Location Map''']</td></tr><tr><td style="background:#eee; border:0px solid #AFA3BF" colspan="2" align="center"><sabremap lat={{{lat}}} lon={{#var:longitude}} zoom={{#var:mapzoom}} width=250 height={{{height}}}
 
                          {{#if: {{{layer|}}} | layer={{{layer}}} | }}
 
                          {{#if: {{{trace|}}} | trace={{{trace}}} | }}
 
                          {{#if: {{{static|}}} | static={{{static}}} | }}
 
                          /></td></tr><tr><td></td></tr><tr><td></td></tr>
 
                    }}
 
              }}
 
        }}
 
  }}<!--
 
  
  

Revision as of 18:53, 29 October 2015

Documentation: Infobox

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 is almost never used by itself, but is instead called by other templates.

Do not edit this template unnecessarily as it is included in about 7,000 pages. This causes issues regarding the Job Queue, after an update it takes 7,000 page views to clear the job queue. If edited twice, that number doubles to 14,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:Infobox sandbox first.

The template calls the following sub-templates, which format specific sections consistently:

This template is called by the following templates, which set up various parameters appropriate for each use. Changes here will affect all of the below templates:

To use this template, copy the code below, replacing anything within <tags> as appropriate.

{{Infobox | <lots> }}

<lots> - There are literally hundreds of different options available. See the Help:Routeboxes page for details of how to use this template, though please bear in mind that the specific templates should be used in nearly every case rather than this master template.


Infobox