Template:Tweed bridges: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
No edit summary
RB (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
|2=4
|2=4
|3=4
|3=4
|46
|49
|47
|50
|48=45
|51=48
|{{Tweed bridge list|{{PAGENAME}}|n}} }} }} }}{{#vardefine:b-3|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name 2}}]]}} }}{{#vardefine:b-2|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name 2}}]]}} }}{{#vardefine:b-1|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name 2}}]]}} }}{{#vardefine:b0|{{#ifeq:{{Tweed bridge list|{{#var:bn}}|name 2}}||{{ifif|{{Tweed bridge list|{{#var:bn}}|name}}}}|[[{{Tweed bridge list|{{#var:bn}}|name}}|{{Tweed bridge list|{{#var:bn}}|name 2}}]]}} }}{{#vardefine:b1|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name 2}}]]}} }}{{#vardefine:b2|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name 2}}]]}} }}{{#vardefine:b3|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name 2}}]]}} }}
|{{Tweed bridge list|{{PAGENAME}}|n}} }} }} }}{{#vardefine:b-3|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-3}}|name 2}}]]}} }}{{#vardefine:b-2|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-2}}|name 2}}]]}} }}{{#vardefine:b-1|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}-1}}|name 2}}]]}} }}{{#vardefine:b0|{{#ifeq:{{Tweed bridge list|{{#var:bn}}|name 2}}||{{ifif|{{Tweed bridge list|{{#var:bn}}|name}}}}|[[{{Tweed bridge list|{{#var:bn}}|name}}|{{Tweed bridge list|{{#var:bn}}|name 2}}]]}} }}{{#vardefine:b1|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+1}}|name 2}}]]}} }}{{#vardefine:b2|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+2}}|name 2}}]]}} }}{{#vardefine:b3|{{#ifeq:{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name 2}}||{{ifif|{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name}}}}|[[{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name}}|{{Tweed bridge list|{{#expr:{{#var:bn}}+3}}|name 2}}]]}} }}
{| align="center" class="toccolours" width="100%" cellspacing="0" style="clear: all; margin-top: 0.5em"
{| align="center" class="toccolours" width="100%" cellspacing="0" style="clear: all; margin-top: 0.5em"
Line 13: Line 13:
| {{#var:b3}} || {{#var:b2}} || {{#var:b1}} || {{#var:b0}} || {{#var:b-1}} || {{#var:b-2}} || {{#var:b-3}}
| {{#var:b3}} || {{#var:b2}} || {{#var:b1}} || {{#var:b0}} || {{#var:b-1}} || {{#var:b-2}} || {{#var:b-3}}
|}<noinclude>{{documentation}}
|}<noinclude>{{documentation}}
[[Category:Bottom boxes|Tweed bridges]]</noinclude>
[[Category:Bottom boxes|Tweed bridges]]
[[Category:Bridge templates]]</noinclude>

Latest revision as of 22:04, 25 August 2020

Bridges and crossings on the River Tweed
Royal Tweed Bridge Berwick Bridge mouth
[edit] [{{#invoke:Purge|main}}] Template documentation

{{Tweed bridges}} is a bottom box that may be included at the foot of any article about a bridge on the River Tweed, from the Mouth of the river up to its source at Tweed's Well. It should show the bridge which the article concerns and the next three crossings each side, upstream and downstream (or in the case of one close to either end of the range, that end of the range).

The bottom box runs off a database template, {{Tweed bridge list}}. The text of this template was generated with a mail merge from an Excel file held by RB, so if a bridge has to be added or deleted, the merge should be re-run, to avoid having to renumber every data record.

(The '#switch' function at the start of {{Tweed bridges}} will also have to be adjusted if the number of data records increases or decreases.)

If the name of the Article does not match the name given in the data template {{Tweed bridge list}} (in the #switch:{{{1}}} function and as "name=") then it will not "catch" and the data (and the Excel file) should be changed. A short name can be given in "name 2=".

The bridge name will be shown on the list just in black if there is no corresponding article, but it will appear as a blue link when an article is created. If the "name 2=" field is filled in, it will appear as a link even if there is no article yet.