Difference between revisions of "Template:Driver"

From LFS Manual
Jump to navigationJump to search
(New param "boldName": support for making nickname bold (will be useful in Template:1st, once 1st/2nd/3rd templates implement this Driver template correctly))
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#if:{{{laptime|}}}|{{{laptime|}}} | }} {{#if:{{{1|}}}|{{{1|}}}}} {{#if:{{{2|}}}|({{{2|}}})}}</includeonly><noinclude>
+
<includeonly>{{#switch:{{{streak}}}
 +
|start=style="vertical-align: middle; text-align: {{{align|center}}}; border-top: 2px solid; border-left: 2px solid; border-right: 2px solid;"{{!}}
 +
|end=style="vertical-align: middle; text-align: {{{align|center}}}; border-bottom: 2px solid; border-left: 2px solid; border-right: 2px solid;"{{!}}
 +
}}{{#if:{{{laptime|}}}|{{{laptime|}}}<nowiki> | </nowiki>}}{{#if:{{{flag|}}}|{{#ifeq:{{{flag|}}}|unknown|{{flag icon}}|{{flag icon|{{{flag|}}}}}}}}} {{#if:{{{1|}}}| {{#ifeq:{{{boldName|}}}|yes|'''{{{1|}}}'''|{{{1|}}} }} }}&nbsp;{{#if:{{{2|}}}|<span style="font-size:75%">({{#ifeq: {{{link|1}}}|1| {{LFSW stats link|{{{2|}}} }}| {{{2|}}} }})</span>}}</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 11:30, 25 June 2025

Template Info-Icon.png

Template documentation

View - Edit

Formats a driver name, username and laptime. It can be used in both plain text and table cells. Two optional parameters specify the driver's name and their username, respectively. If the |laptime= parameter is defined, it gets put in front of the driver info, separated with a vertical line (pipe) symbol (|) - this is useful for indicating Fastest laps / Pole position laptimes in a single cell.

For indicating podium positions in colored table cells, see templates {{1st}}, {{2nd}}, {{3rd}}. Uses {{flag icon}} and {{LFSW stats link}} internally.

Usage

{{Driver
|1             = nickname
|2             = lfsw username
|flag          = 
|laptime       = 
|streak        = 
|boldName      = 
}}

This template prefers inline formatting of parameters.

Parameters

Template:Driver parameters and basic guidelines
Parameter Explanation Example values Required?
1 Driver nickname. Unnamed parameter. Average Joe Yes
2 Driver LFSW username. Unnamed parameter. avgjoe123 Optional
flag Inserts a flag icon. If you set unknown, a question mark icon is output. Hidden by default. For flag codes, see {{flag icon}}. UK, DE, unknown Optional
laptime In the context of pole positions and fastest laps, laptime of driver. Appears before the driver name, separated by a pipe symbol. 1:25.32 Optional
streak When used as a table cell, highlights beginning or end of streak. One of the following: start, end. start, end Optional
boldName If set to yes, the driver nickname will be highlighted in bold. yes Optional
link When a value is set to 0, the LFSW username will not be a link to LFS World. 0 Optional

Examples

Markup Renders as
{{Driver|Average Joe|avgjoe123}}

Average Joe (avgjoe123)

Markup Renders as
{{Driver|Average Joe|avgjoe123|flag=JP}}
Japan
Average Joe (avgjoe123)
Markup Renders as
{{Driver|Average Joe|avgjoe123|flag=JP|boldName=yes}}
Japan
Average Joe (avgjoe123)
Markup Renders as
{{Driver|Average Joe|avgjoe123|laptime=1:24.75}}

1:24.75 | Average Joe (avgjoe123)

Markup Renders as
{{Driver|Average Joe|avgjoe123|flag=IT|laptime=1:24.75}}
1:24.75 |
Italy
Average Joe (avgjoe123)
Markup Renders as
{{Driver|Average Joe|avgjoe123|link=0}}

Average Joe (avgjoe123)