Template talk:Infobox Locomotive Auto
From Wikipedia, the free encyclopedia
Contents |
[edit] Simplifying the code
I tried making a quick update to the builder code to simplify it for maintenance and remove case sensitivity on the parameter text, but ran into an edit conflict. Use this instead of the builder code that's there and you don't need the builderother param...
{{#if: {{{builder|}}} |<tr><th>Builder</th><td style="text-align: center;">{{#switch: {{lc:{{{builder|}}}}} | alco = [[American Locomotive Company]] (ALCO) | blw = [[Baldwin Locomotive Works]] (BLW) | bt = [[Bombardier Transportation]] (BT) | clc = [[Canadian Locomotive Company]] (CLC) | dlw = [[Diesel Locomotive Works]] (DLW) | emd = [[Electro-Motive Diesel]] (EMD) | fm = [[Fairbanks-Morse]] (FM) | ge = [[GE Transportation Systems|General Electric]] (GE) | gmd = [[General Motors Diesel]] (GMD) | gm-emd = [[Electro-Motive Diesel|General Motors Electro-Motive Division]] (GM-EMD) | hamilton = [[Lima-Hamilton Locomotive Works]] (LHLW) | lima = [[Lima-Hamilton Locomotive Works]] (LLW) | mlw = [[Montreal Locomotive Works]] (MLW) | rpt = [[RailPower Technologies]] (RPT) | #default = {{{builder}}} }}</td></tr>}}
Moving the text that is common to all cases outside of the switch makes that easier to read, and wrapping the {{{builder}}} at the top of the switch within {{lc:}} forces the text to lower case for comparison, reducing the number of cases. Also, using the #default case will catch anything that isn't specifically coded.
You can also combine several cases into one line, so the hamilton line could be written as:
| lh | hamilton = [[Lima-Hamilton Locomotive Works]] (LHLW)
and then both "lh" and "hamilton" will produce the same output. Slambo (Speak) 16:37, 12 December 2007 (UTC)
Coolness! I guess I could do the same for the AAR section as well.. Soon enough I hope to have the template modularized once I can figger out how to do it. :D The only thing that is peculiar is without the builderother option it doesn't show up on the template when you view it like all the other fields do. It's literally invisible unless there is a option chosen. Thanks for the help! --DP67 (talk/contribs) 17:04, 12 December 2007 (UTC)
- Ah, that's controlled at the very top. Change {{#if: {{{builder|}}} to {{#if: {{{builder<includeonly>|</includeonly>}}}. The magic is in the noinclude call around the | character. Slambo (Speak) 17:17, 12 December 2007 (UTC)
[edit] AAR Section..
If you look at the AAR section you'll see how I archived the automatic corresponding UIC Class as well. I tried it with the simple code and it's not working.. Any suggestions on how to simplify things and still accomplish the same result? I'd like to do the same with the UIC section as well. Even though between the two there are a few that just don't match, at least the most common ones do. DP67 (talk/contribs) 18:16, 12 December 2007 (UTC)
- Fixed... Removed extra squiggle bracket in the code. --DP67 (talk/contribs) 18:27, 12 December 2007 (UTC)
Ive added Bo-Bo, etc to the categories and repeated the syntax for them but in order to get the SBB Re 460 page to appear on the category I've needed to add a {{pagename}} to the category. Is this needed elsewhere or was I being caught out by propagation delays? Railwayfan2005 (talk) 23:26, 9 January 2008 (UTC)
Bo-Bo, Co-Co, Etc. already have a section under UIC classification (uicclass) separate from AAR wheel arrangement (aarwheels). Adding UIC Classes to the AAR section will throw off proper linking to the related article. Docs are placed side by side for reference purposes. This template is an ever evolving project and many other options are planned but have yet to add. I have not added any European builders because I don't know the most popular ones. Although fitting every one in there is nearly impossible I do plan on adding the most popular as I have done with the US builders. It's not a perfect template as there are still a few dents to hammer out.
[edit] Suggested Things to Add
- Linking and categorisation by country.
- Linking and categorisation by operator.
- Linking and categorisation by electrical system.
- More builders.
Railwayfan2005 (talk) 23:26, 9 January 2008 (UTC)
[edit] Docs
User:Dp67 wrote (as they reverted my edit) Docs may be moved when template is done..
- As this is Wikipedia, where nothing is ever "done", I propose we move the documentation anyway... Railwayfan2005 (talk) 21:05, 14 January 2008 (UTC)
-
- The main reason why the docs are part of the page is because I don't like how Wikipedia always seems to be so complex when it is unnecessary. Wikipedians have a bad habit of making help a few dozen clicks away when needed when It doesn't have to be. In case you haven't noticed, or haven't been reading my posts as to the purpose of this template, its main purpose to try to make things easier. That is the reason for the auto linking, auto categorizing, and auto conversions found within the template. The goal is to provide the most amount of information to the reader, with the least amount of work for the editor. That way attention can be focused on writing the article, not studying templates and infoboxes, and typing links to common related articles. Which is also the reason I chose to base the template on the widely used {{Infobox Locomotive}} since its structure and requirements are already widely known. The in your face documentation is part of that principle of keeping it simple. You don't have to scroll down 4 pages to read the docs or click off the page to read the docs. Providing links at the bottom of the the template to the templates page, and to the Wiki Trains project is also part of that plan.. Everything is right there in your face, or nearby. custom tailored to "Keep It Simple" --DP67 (talk/contribs) 01:49, 17 January 2008 (UTC)
-
-
- Fine, I will follow your lead. Railwayfan2005 (talk) 21:51, 17 January 2008 (UTC)
-
[edit] Multi System Electric lcoos
Any ideas on how to handle multi system locos on the template? It's easy enough to follow the aar or uid leads and make a list of values for voltages, (1500 V, 25 kV, etc) which have links and cause categorisation. What efficient options are there for locos which work on two or more systems? I'm happy build the template but where to start... Railwayfan2005 (talk) 21:51, 17 January 2008 (UTC)
-
- I've been thinking of ways to implement that. Problem is there are so many variants between voltages and AC/DC current not to mention 25,50,60 cycle Would be nice if there was some standard to electric railways but there isn't. Even here in the US there are probably a dozen or so different designs. --DP67 (talk/contribs) 02:17, 18 January 2008 (UTC)
[edit] Template:Locomotive Service History Auto
I've created {{Locomotive Service History Auto}} for locos with more than one operator/owner. It takes the same parameters as {{Infobox Locomotive Auto}} so it should just be straight forward slotting it in on the relevant pages... Railwayfan2005 (talk) 18:08, 26 January 2008 (UTC)
[edit] Speed conversions
Having discovered {{convert}} how about we add topspeedkph and topspeedmph and then use {{convert|{{{topspeedkph}}}|km/h|mph|abbr=on|sigfig=2}} and {{convert|{{{topspeedmph}}}|mph|km/h|abbr=on|sigfig=2}}''' to display them in both metric and imperial?
Keep the existing code for compatibility...
Railwayfan2005 (talk) 20:06, 29 January 2008 (UTC)