Template talk:RoutemapRoute

From Wikipedia, the free encyclopedia

This article is within the scope of WikiProject Trains, an attempt to build a comprehensive and detailed guide to rail transport on Wikipedia. If you would like to participate, you can visit the project page, where you can join the project and/or contribute to the discussion.
See also: WikiProject Trains to do list
Template This page is a template and does not require a rating on the quality scale. (assessment comments)
??? This article has not yet received a rating on the importance scale within the Trains WikiProject.

Contents

[edit] Development Ideas

This template was created mainly to allow the addition of (<–Bristol–Paddington–>) -type information to routemaps, for example, where a branch-line meets a main-line, to indicate the direction of traffic flow on the associated route.

Little thought went into the initial design, however, during creation I realised that it could be used more generically, and all the 'conditional stuff' was put in too.

Now, before it is rolled-out to other routemaps, it seems sensible to canvass opinion regarding the template features and usability, in case any changes need to be applied.

Certain questions spring to mind, but other editors may have additional comments to make...

  1. Is the name "RoutemapRoute" OK?
    (I couldn't think of anything better at the time.)
  2. The main parameter names are currently 'to' and 'from'. Are these OK? Or would it be clearer to use 'left' and 'right' instead, or something else?
  3. The arrows were the first suitable icons I found within Wikipedia. I think they look OK -- they certainly don't look out-of-place in the routemaps -- but are there any which would be better suited?
  4. Is there a need to be able to disable the outer brackets?
    (Can be achieved with an optional parameter if this is a requirement.)
  5. Is there a likely need for 'to' or 'from' uses where the arrow points to the text, rather than away from it?
    (This might be best served with a second template with the icons the other way round.)
  6. Are there any other permutations I haven't thought of?

Comments welcome.

EdJogg 10:33, 12 September 2007 (UTC)

Excellent idea. I would have thought that left= and right= would be more useful. Up= and down= might also be useful, for example in Tipton Green and Toll End Canals. The concept of to and from rather depends on where you think the start is! Also, brackets=no and towardstext=yes might be useful. Best wishes. Oosoom Talk to me 13:09, 12 September 2007 (UTC)
Thank you. Have found these in the same set ( ), so up/down should be possible.
(Boy is it going to be hard to read the source code!) -- EdJogg 13:54, 12 September 2007 (UTC)

Agree that left=, right=, up= and down= would be more intuitive to specify the arrows appropriately. However, it should be noted that up and down do not necessarily refer to the direction of the train's travel in relation to London as the terms "up train" and "down train" are not used in North America (but commuter lines typically use "inbound" and "outbound" in relation to whatever the main city center is).

BTW, I found and removed an extra </noinclude> statement that was messing up the formatting on the examples you gave elsewhere. Slambo (Speak) 16:00, 12 September 2007 (UTC)

Thanks for the tweak. I'm now developing templates using a user sandbox for the purpose, so such issues should be avoided in future.
As for the parameters, I am mulling-over a format which specifies the arrows and text separately, such that 'Up/Down/Left/Right' will simply indicate the direction of the arrow. Unfortunately, this requires a ground-up redesign of the template...!
As you're well-versed in template technology, could you suggest a good example that uses 'switch'?
EdJogg 17:31, 12 September 2007 (UTC)
Well, {{TrainsWikiProject}} makes extensive use of switches, but it seems simpler to allow the user to put in something like {{RoutemapRoute| up=StationA| down=StationB}} ( StationA - StationB ) or even a mix like {{RoutemapRoute| left=StationC| down=StationD}} ( StationC - StationD ). Why someone would want to mix up/down and left/right like this is left to be seen, but we should be able to do something like:
 ({{#if:{{{up|}}}|[[Image:Arrow Blue Up 001.jpeg|10px]] {{{up}}} }}<!--
 -->{{#if:{{{left|}}}|[[Image:Arrow Blue Left 001.jpeg|10px]] {{{left}}} }} - <!--
 -->{{#if:{{{down|}}}|[[Image:Arrow Blue Down 001.jpeg|10px]] {{{down}}} }}<!--
 -->{{#if:{{{right|}}}|[[Image:Arrow Blue Right 001.jpeg|10px]] {{{right}}} }})
 
This doesn't include logic to hide the hyphen symbol if only one of the two sides is specified, but that's the basic idea. Slambo (Speak) 17:45, 12 September 2007 (UTC)
Don't just think of railways - other maps may want left/up/right/down all on the same line (perhaps to indicate destinations on a (rambling) sign post? Canal maps might very well start with left/up/right as does Tipton Green and Toll End Canals. Oosoom Talk to me 18:38, 12 September 2007 (UTC)
Are 3-/4-arrow instances really required? Please discuss in new section below. EdJogg 09:04, 13 September 2007 (UTC)

[edit] Braces or Brackets?

I don't think braces is the correct term for the ( ) symbols. Braces are { }, brackets are [ ], and parentheses are ( ). However, in common usage, brackets often mean ( ) and are also a generic term for enclosing marks - useful if the type of punctuation symbol or even some other graphic were to be chosen in future.  :) Oosoom Talk to me 08:34, 13 September 2007 (UTC)

Heck, I'll go with the flow...I just don't suggest anyone starts using this template yet! (It's fine on your sandbox though.) Getting it 'just right' will take time...
Since there may be potential US users of this template, perhaps Slambo can confirm that the term 'brackets' would be an acceptable replacement?
EdJogg 08:50, 13 September 2007 (UTC)
As I know them "(" and ")" are parentheses, "{" and "}" are curly braces or curly brackets, "[" and "]" are square brackets or sometimes just brackets. Perhaps a better term for a parameter name here would be "enclosed"? Slambo (Speak) 11:28, 13 September 2007 (UTC)
Good lateral thinking: 'enclosed' it is, then, unless anyone objects strongly. EdJogg 13:13, 13 September 2007 (UTC)

[edit] Multiple routes (>2)

This template is only proposed to support 1 or 2 routes (arrows). Is there much need for a 3- or 4-arrow template? If so, it might be best to create a second template based on the 1-/2-arrow original. 'Nesting' them will ensure consistency, but will require some interesting code!

For the example given earlier, Tipton Green and Toll End Canals, the top line (for Walsall Canal) could use a 4-arrow template. Alternatively, if an extra icon row is added above and below the Walsall Canal, only 2-arrow templates will be needed ('up' is covered by "Tame Valley Canal", 'Down' can be handled by a new entry for "Ocker Hill Tunnel Jn" on the line below (as it gives no detail of this at present), and the additional line above can use the existing 2-arrow template to indicate the left/right destinations of the "Walsall Canal" itself).

Are there any other examples where a 3- or 4-arrow template would have to be used?

EdJogg 09:03, 13 September 2007 (UTC)

Fine. Thanks for considering it. I imagine two arrows will be fine for nearly everything. Oosoom Talk to me 19:34, 13 September 2007 (UTC)

[edit] RoutemapRoute - REDESIGN

I have taken on board all of the above comments and attempted a redesign.

The new version has the following features:

  • Display of one or two 'placenames' (or none!)
  • Hyphen when two placenames defined
  • Left/Right/Up/Down or no arrows to left and/or right (positioned as for original template)
  • Arrow selection independent of text
  • Suppressable brackets (enclosure)

I have created a new subtemplate: {{RoutemapRouteIcon}} which allows selection of the arrow icon, and potential for future expansion (other colour icons?)

The revised RoutemapRoute template code is lurking in my new template sandbox, but examination of this sandbox will show you:

  • the (unformatted) template source code
  • wikisource for 12 variations that the template can produce
  • example output corresponding to the wikisource

(I have not included the code/examples on this page, as the sandboxes will be re-used once the new code has gone live, and the links would become stale.)

Before rolling-out the revised template, which will require all existing uses to be re-written, I wanted to sound-out the parameters I have used:

  • Licon=XXX - selects the left icon (valid parameters listed at {{RoutemapRouteIcon}})
  • Ricon=XXX - ditto for right icon
  • Station A, Station B - no parameter names, just separate entries in template. Where two are defined, first will be placed on left and a hyphen will separate them.
  • enclosed=no - disables the brackets (if omitted, brackets appear by default)

In particular, are 'Licon' and 'Ricon' appropriate names to use? Would 'L' and 'R' be better alternatives? (would they be allowed?)

All (constructive) comments welcome!

EdJogg 15:59, 13 September 2007 (UTC)