# வார்ப்புரு:Rail icon/doc



**Template:Rail icon** returns an icon, an image or another preset value, from a subpage of .  

## Usage
<code>Module:Adjacent stations/<var>system</var></code> must exist for this template to work.  
- 
- 
- 

### Variables
- <var>system</var> is the name of the system or an abbreviation.
- <var>line</var> is the line name, if any.
- <var>branch</var> is the name of the branch or service, if any.

## Parameters
Optional parameters:  
- – image size, expressed as width (<code></code>), height (<code>x15px</code>) or both if necessary (<code>15x15px</code>).
- – image link (full page name)
- – alt text
- – setting for some types of text-based icon; default is "yes" for all of those types
- – setting to any value will add the system or line name.

## Examples
Using Module:Adjacent stations/MTR:  
- 
- 
- 
- 
- (using the "isl" alias)

If there are two or more images by default, then the image-applicable values will be set for all of them.  

## Addition of values in module subpages

(For simplicity, is used here to refer to the p._box function in Module:Adjacent stations.)  

Each module subpage sends a Lua table to Module:Adjacent stations. The outermost table (often the table called <code>p</code>, or otherwise the table after <code>return</code>. Lua tables (<code>{ <var>...</var> }</code>) contain *keys* and *values*, which can be in the format <code>["<var>key</var>"] = <var>value</var></code>. Values can be strings/characters (<code>"<var>value</var>"</code>, tables, or other values. Key–value pairs are separated by commas.  

In the main (outermost) table, either or both of the keys "icon format" and "icon" can be used to specify an icon (i.e. as an entry in the table like <code>["icon"] = "<var>value</var>"</code>).  

The value for "icon" is the standard file syntax for an inline image; there should be alt text, a page link and a size value; see .  

If there is a value for the "icon format" key and it is not "image", then is used, with the display style being the value of "icon format"; all inputs except "alt" and "size" are passed through appropriately. (Note that does not currently work without a line name.)  

Lines are added as tables with named keys inside the "lines" table, which is inside the main table (i.e. <code>... ["lines"] = {["<var>line name</var>"] = { <var>... line table ...</var> } } ...</code>). Entries for "icon format" and "icon" work similarly inside these tables. If many lines have the same icon format, then a "line icon format" value can be added to the main table.  

Types are added as tables inside their line tables (each type is a variation of a line). Entries for "icon format" and "icon" work similarly inside these tables. If many types have the same icon format, then a "type icon format" value can be added to the main table.  

Lines and types can have aliases; these are all listed in the table with the key "aliases" inside the main table. The keys in that table should be lowercase, and the values should refer to the key of a branch or line table (e.g. <code>... ["aliases"] = {["r"] = "Red", ["b"] = "Blue"} ...</code>, where both "Red" and "Blue" are valid line or type names).  

If is used, then the key "color" and any of the keys "line title", "branch title", "short name" and "text color" should be present in the applicable table.