Template:LocoInfobox: Difference between revisions

A searchable database of Lionel O Gauge locomotives
(initial template creation)
(initial template creation)
Line 1: Line 1:
<noinclude>
<noinclude>
== Template:LocoTechInfobox/Lionel ==
== Template:LocoInfobox ==
Manufacturer tech infobox for Lionel product pages. Orange header (#E8650A) — distinct
Universal infobox for individual product pages. Color is automatically determined by
from the loco-category-driven universal infobox above it. Called directly below
the <code>loco_category</code> parameter via #switch. Never set color manually.
{{LocoInfobox}} with no blank line between — MediaWiki renders both as a visual stack.


All fields are always shown with ☑ or ☐. Fields are never hidden an unchecked box
Called on every product page alongside <code>{{LocoTechInfobox/Lionel}}</code> directly
is meaningful information (this system is not supported).
below it. No blank line between the two template calls MediaWiki renders them as a
visual stack: universal infobox on top, tech infobox directly below, both right-aligned.


Values come directly from the spreadsheet Technical Features columns (Yes/No):
The road name logo appears at the very top of the infobox. The template automatically
* Col 11: Legacy Control System
constructs the filename from the road_name parameter. If no logo file exists, the road
* Col 12: TMCC
name is displayed as a text label.
* Col 13: Bluetooth
* Col 14: LC Universal Remote
* Col 15: LC Individual Remote
* Col 16: Conventional Control
* Col 19: Sound
* Col 20: Smoke Unit
* Col 21: Odyssey (Speed Control)
* Col 22: ElectroCoupler


Requires: ParserFunctions extension (ships with MediaWiki 1.39, enabled by default).
Requires: ParserFunctions extension + <code>$wgPFEnableStringFunctions = true</code>
(for <code>#replace</code> to construct logo filenames).


=== Usage ===
=== Usage ===
<pre>
<pre>
{{LocoTechInfobox/Lionel
{{LocoInfobox
| legacy       =  
| item_number        =
| tmcc        =  
| manufacturer       =  
| bluetooth    =  
| loco_type          =  
| lc_universal =  
| wheel_arr          =  
| lc_individual =  
| proto_manufacturer =  
| conventional =  
| loco_category      =  
| sound       =  
| road_name          =  
| smoke        =  
| road_number       =  
| odyssey      =  
| proto_era          =
| electrocoupler =  
| year              =
| catalog_season    =
| product_line      =
| scale              =
| min_curve          =
| run_type          =  
| msrp              =  
| notes              =  
}}
}}
</pre>
</pre>


=== Parameters ===
=== Parameters ===
All parameters accept Yes or No (case-insensitive). ☑ renders for Yes, ☐ for No or empty.
{| class="wikitable"
{| class="wikitable"
! Parameter !! Spreadsheet Column !! Description
! Parameter !! Description !! If Empty
|-
|-
| <code>legacy</code> || Col 11 — Legacy Control || Legacy Control System compatible
| <code>item_number</code> || Catalog item number ||
|-
|-
| <code>tmcc</code> || Col 12 — TMCC Control || TMCC compatible
| <code>manufacturer</code> || Manufacturer name; linked to manufacturer category page ||
|-
|-
| <code>bluetooth</code> || Col 13 — Bluetooth || Bluetooth / app control
| <code>loco_type</code> || Linked to Loco Type category page ||
|-
|-
| <code>lc_universal</code> || Col 14 — LC Universal Remote || LC Universal Remote compatible
| <code>wheel_arr</code> || Wheel arrangement; linked to Wheel Arr. category page for Steam, plain text for all others ||
|-
|-
| <code>lc_individual</code> || Col 15 — LC Individual Remote || LC Individual Remote included
| <code>proto_manufacturer</code> || Prototype builder. Non-steam: linked to Proto Mfg category page. Steam/Other: plain text. ||
|-
|-
| <code>conventional</code> || Col 16 — Conventional Control || Conventional transformer control
| <code>loco_category</code> || Drives color scheme; linked to Loco Category page. Values: Steam, Diesel, Electric, Cab Car, Other ||
|-
|-
| <code>sound</code> || Col 19 — Sound || Sound system present
| <code>road_name</code> || Linked to Road Name category page; drives logo display at top of infobox ||
|-
|-
| <code>smoke</code> || Col 20 — Smoke Unit || Smoke unit present
| <code>road_number</code> || Prototype road number on the model ||
|-
|-
| <code>odyssey</code> || Col 21 — Odyssey (Speed Control) || Odyssey speed control present
| <code>proto_era</code> || e.g. 1945–1964 ||
|-
|-
| <code>electrocoupler</code> || Col 22 ElectroCoupler || ElectroCoupler present
| <code>year</code> || Catalog year; linked to Catalog Year category page ||
|-
| <code>catalog_season</code> || e.g. Vol 2 || —
|-
| <code>product_line</code> || Linked to Product Line category page || —
|-
| <code>scale</code> || Scale or Non-Scale; linked to Scale category page || —
|-
| <code>min_curve</code> || Minimum curve radius e.g. O36 || —
|-
| <code>run_type</code> || e.g. Catalog Run, Built to Order, Limited Run || —
|-
| <code>msrp</code> || Original retail price at release || —
|-
| <code>notes</code> || Free text notes from spreadsheet. '''Hidden entirely when empty.''' || (hidden)
|}
|}


=== Color Reference ===
=== Color Reference ===
Orange throughout — signals manufacturer-specific block.
Colors applied automatically via loco_category. Do not set manually.
{| class="wikitable"
{| class="wikitable"
! Element !! Hex
! loco_category !! Header (dark) !! Alt rows (light)
|-
|-
| Header / sub-headers || #E8650A
| Steam || #6B1E2A || #F5E6E8
|-
|-
| Alternating rows || #FDE8D8
| Diesel || #4A4A4A || #F0F0F0
|-
| Electric || #8B6914 || #FDF6D8
|-
| Cab Car || #8B6914 || #FDF6D8
|-
| Other / default || #1E2B7A || #D0D5F0
|}
|}
</noinclude><includeonly><div class="railrosterdb-infobox loco-infobox" style="float:right; clear:right; margin:0 0 0 1em; width:280px; border:1px solid #aaa; background:#fff; font-size:0.9em; line-height:1.5;">


=== Notes ===
<!-- ROAD NAME LOGO / LABEL -->
* When a second manufacturer is added, create Template:LocoTechInfobox/[MfgName] with
<div style="background:{{#switch:{{{loco_category|}}}|Steam=#6B1E2A|Diesel=#4A4A4A|Electric=#8B6914|Cab Car=#8B6914|#default=#1E2B7A}}; padding:6px 8px; text-align:center; border-bottom:1px solid rgba(255,255,255,0.3);">{{#ifexist:File:Logo-{{#replace:{{{road_name|}}}| |-}}.png
  that manufacturer's own fields. No changes needed to this template.
| [[File:Logo-{{#replace:{{{road_name|}}}| |-}}.png|260px|center|{{{road_name|}}}]]
* The Bluetooth row is styled distinctly (highlighted background) consistent with the
| <span style="color:#ffffff; font-weight:bold; font-size:1.05em;">{{{road_name|}}}</span>
  Product Line compat tables — it visually separates the protocol systems above and below.
}}</div>
</noinclude><includeonly><div class="railrosterdb-infobox loco-tech-infobox" style="float:right; clear:right; margin:0 0 1em 1em; width:280px; border:1px solid #aaa; background:#fff; font-size:0.9em; line-height:1.5;">


<!-- TECH INFOBOX TITLE -->
<!-- INFOBOX TITLE -->
<div style="background:#E8650A; color:#ffffff; font-weight:bold; padding:5px 8px; text-align:center;">Lionel Technical Features</div>
<div style="background:{{#switch:{{{loco_category|}}}|Steam=#6B1E2A|Diesel=#4A4A4A|Electric=#8B6914|Cab Car=#8B6914|#default=#1E2B7A}}; color:#ffffff; font-weight:bold; padding:5px 8px; text-align:center; border-top:1px solid rgba(255,255,255,0.2);">{{PAGENAME}}</div>


<!-- MAIN FIELDS -->
<table style="width:100%; border-collapse:collapse;">
<table style="width:100%; border-collapse:collapse;">


<!-- CONTROL SYSTEMS SUB-HEADER -->
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
  <th style="padding:3px 6px; text-align:left; font-weight:bold; width:45%;">Item #</th>
  <td style="padding:3px 6px;">{{#if:{{{item_number|}}}|{{{item_number}}}|—}}</td>
</tr>
<tr>
  <th style="padding:3px 6px; text-align:left; font-weight:bold;">Manufacturer</th>
  <td style="padding:3px 6px;">{{#if:{{{manufacturer|}}}|[[:Category:{{{manufacturer}}} Locomotives|{{{manufacturer}}}]]|—}}</td>
</tr>
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
  <th style="padding:3px 6px; text-align:left; font-weight:bold;">Loco Type</th>
  <td style="padding:3px 6px;">{{#if:{{{loco_type|}}}|[[:Category:{{{loco_type}}}|{{{loco_type}}}]]|—}}</td>
</tr>
<tr>
  <th style="padding:3px 6px; text-align:left; font-weight:bold;">Wheel Arr.</th>
  <td style="padding:3px 6px;">{{#if:{{{wheel_arr|}}}|{{#ifeq:{{{loco_category|}}}|Steam|[[:Category:{{{wheel_arr}}}|{{{wheel_arr}}}]]|{{{wheel_arr}}}}}|—}}</td>
</tr>
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
  <th style="padding:3px 6px; text-align:left; font-weight:bold;">Proto. Manufacturer</th>
  <td style="padding:3px 6px;">{{#if:{{{proto_manufacturer|}}}|{{#ifeq:{{{loco_category|}}}|Steam|{{{proto_manufacturer}}}|{{#ifeq:{{{loco_category|}}}|Other|{{{proto_manufacturer}}}|[[:Category:{{{proto_manufacturer}}} Locomotives|{{{proto_manufacturer}}}]]}}}}|—}}</td>
</tr>
<tr>
<tr>
   <td colspan="2" style="background:#E8650A; color:#ffffff; font-weight:bold; padding:3px 8px; font-size:0.9em;">Control Systems</td>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Loco Category</th>
  <td style="padding:3px 6px;">{{#if:{{{loco_category|}}}|[[:Category:{{{loco_category}}} Locomotives|{{{loco_category}}} Locomotives]]|—}}</td>
</tr>
</tr>
 
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
<!-- BLUETOOTH — highlighted row -->
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Road Name</th>
<tr style="background:#FDE8D8;">
   <td style="padding:3px 6px;">{{#if:{{{road_name|}}}|[[:Category:{{{road_name}}}|{{{road_name}}}]]|}}</td>
   <th style="padding:3px 6px; text-align:left; font-weight:bold; width:75%;">Bluetooth</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{bluetooth|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
</tr>
</tr>
<!-- DIVIDER -->
<tr><td colspan="2" style="padding:0; height:1px; background:#a2a9b1;"></td></tr>
<tr>
<tr>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Legacy Control System</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Road Number</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{legacy|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{road_number|}}}|{{{road_number}}}|}}</td>
</tr>
</tr>
<tr style="background:#FDE8D8;">
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">TMCC</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Prototype Era</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{tmcc|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{proto_era|}}}|{{{proto_era}}}|}}</td>
</tr>
</tr>
<tr>
<tr>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">LC Universal Remote</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Catalog Year</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{lc_universal|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{year|}}}|[[:Category:{{{year}}}|{{{year}}}]]|}}</td>
</tr>
</tr>
<tr style="background:#FDE8D8;">
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">LC Individual Remote</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Catalog Season</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{lc_individual|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{catalog_season|}}}|{{{catalog_season}}}|}}</td>
</tr>
</tr>
<tr>
<tr>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Conventional</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Product Line</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{conventional|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{product_line|}}}|[[:Category:{{{product_line}}}|{{{product_line}}}]]|}}</td>
</tr>
</tr>


<!-- FEATURES SUB-HEADER -->
<!-- FEATURES SUB-HEADER -->
<tr>
<tr>
   <td colspan="2" style="background:#E8650A; color:#ffffff; font-weight:bold; padding:3px 8px; font-size:0.9em;">Features</td>
   <td colspan="2" style="background:{{#switch:{{{loco_category|}}}|Steam=#6B1E2A|Diesel=#4A4A4A|Electric=#8B6914|Cab Car=#8B6914|#default=#1E2B7A}}; color:#ffffff; font-weight:bold; padding:3px 8px;">Features</td>
</tr>
</tr>


<tr style="background:#FDE8D8;">
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Sound</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Scale</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{sound|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{scale|}}}|[[:Category:{{{scale}}}|{{{scale}}}]]|}}</td>
</tr>
</tr>
<tr>
<tr>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Smoke Unit</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Min. Curve</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{smoke|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{min_curve|}}}|{{{min_curve}}}|}}</td>
</tr>
</tr>
<tr style="background:#FDE8D8;">
<tr style="background:{{#switch:{{{loco_category|}}}|Steam=#F5E6E8|Diesel=#F0F0F0|Electric=#FDF6D8|Cab Car=#FDF6D8|#default=#D0D5F0}};">
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Odyssey Speed Control</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">Run Type</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{odyssey|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{run_type|}}}|{{{run_type}}}|}}</td>
</tr>
</tr>
<tr>
<tr>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">ElectroCoupler</th>
   <th style="padding:3px 6px; text-align:left; font-weight:bold;">MSRP</th>
   <td style="padding:3px 6px; text-align:center; font-size:1.1em;">{{#ifeq:{{lc:{{{electrocoupler|no}}}}}|yes|<span style='color:#E8650A; font-size:1.3em;'>●</span>|}}</td>
   <td style="padding:3px 6px;">{{#if:{{{msrp|}}}|{{{msrp}}}|}}</td>
</tr>
</tr>
<!-- NOTES — hidden entirely when empty -->
{{#if:{{{notes|}}}|
<tr>
  <td colspan="2" style="background:{{#switch:{{{loco_category|}}}|Steam=#6B1E2A|Diesel=#4A4A4A|Electric=#8B6914|Cab Car=#8B6914|#default=#1E2B7A}}; color:#ffffff; font-weight:bold; padding:3px 8px;">Notes</td>
</tr>
<tr>
  <td colspan="2" style="padding:4px 8px; font-size:0.9em;">{{{notes}}}</td>
</tr>
}}


</table>
</table>
</div></includeonly>
</div></includeonly>

Revision as of 15:12, 27 April 2026

Template:LocoInfobox

Universal infobox for individual product pages. Color is automatically determined by the loco_category parameter via #switch. Never set color manually.

Called on every product page alongside

No model photo yet — Upload photo
Lionel Technical Features
Control Systems
Bluetooth
Legacy Control System
TMCC
LC Universal Remote
LC Individual Remote
Conventional
Features
Sound
Smoke Unit
Odyssey Speed Control
ElectroCoupler

directly

below it. No blank line between the two template calls — MediaWiki renders them as a visual stack: universal infobox on top, tech infobox directly below, both right-aligned.

The road name logo appears at the very top of the infobox. The template automatically constructs the filename from the road_name parameter. If no logo file exists, the road name is displayed as a text label.

Requires: ParserFunctions extension + $wgPFEnableStringFunctions = true (for #replace to construct logo filenames).

Usage

{{LocoInfobox
| item_number        = 
| manufacturer       = 
| loco_type          = 
| wheel_arr          = 
| proto_manufacturer = 
| loco_category      = 
| road_name          = 
| road_number        = 
| proto_era          = 
| year               = 
| catalog_season     = 
| product_line       = 
| scale              = 
| min_curve          = 
| run_type           = 
| msrp               = 
| notes              = 
}}

Parameters

Parameter Description If Empty
item_number Catalog item number
manufacturer Manufacturer name; linked to manufacturer category page
loco_type Linked to Loco Type category page
wheel_arr Wheel arrangement; linked to Wheel Arr. category page for Steam, plain text for all others
proto_manufacturer Prototype builder. Non-steam: linked to Proto Mfg category page. Steam/Other: plain text.
loco_category Drives color scheme; linked to Loco Category page. Values: Steam, Diesel, Electric, Cab Car, Other
road_name Linked to Road Name category page; drives logo display at top of infobox
road_number Prototype road number on the model
proto_era e.g. 1945–1964
year Catalog year; linked to Catalog Year category page
catalog_season e.g. Vol 2
product_line Linked to Product Line category page
scale Scale or Non-Scale; linked to Scale category page
min_curve Minimum curve radius e.g. O36
run_type e.g. Catalog Run, Built to Order, Limited Run
msrp Original retail price at release
notes Free text notes from spreadsheet. Hidden entirely when empty. (hidden)

Color Reference

Colors applied automatically via loco_category. Do not set manually.

loco_category Header (dark) Alt rows (light)
Steam #6B1E2A #F5E6E8
Diesel #4A4A4A #F0F0F0
Electric #8B6914 #FDF6D8
Cab Car #8B6914 #FDF6D8
Other / default #1E2B7A #D0D5F0