Template:Racers: Difference between revisions
From Stunts Wiki
No edit summary |
All rows now use conditional display: Each row is wrapped in {{#if: {{{parameter|}}} | ... }} to only show when the parameter has a value Removed default values: No more "unknown" or "none" fallbacks - empty fields simply don't display Consistent formatting: All conditional rows follow the same pattern Special handling: The racername field still shows "unnamed" as default since it's the title Footnotes row: Also made conditional so it only appears when footnotes are provided |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
|- | |- | ||
| colspan="2" style="text-align:center; font-size: large;" | '''{{{racername|''unnamed''}}}''' | | colspan="2" style="text-align:center; font-size: large;" | '''{{{racername|''unnamed''}}}''' | ||
<!-- | <!-- Image row - only display if image is provided --> | ||
|- {{#if: {{{image|}}} | style="text-align:center;" | |- {{#if: {{{image|}}} | style="text-align:center;" | ||
{{!}} colspan="2" {{!}} {{{image | {{!}} colspan="2" {{!}} {{{image}}} | ||
{{!}}- | {{!}}- | ||
|}} style="vertical-align:top;" | |}} | ||
<!-- Nationality row - only display if nationality is provided --> | |||
|- {{#if: {{{nationality|}}} | style="vertical-align:top;" | |||
! Nationality: | ! Nationality: | ||
{{!}} {{{nationality}}} | |||
|- {{#if: {{{location|}}} | | {{!}}- | ||
|}} | |||
<!-- Location row - only display if location is provided --> | |||
|- {{#if: {{{location|}}} | style="vertical-align:top;" | |||
! Location: | ! Location: | ||
{{!}} {{{location | {{!}} {{{location}}} | ||
{{!}}- | {{!}}- | ||
|}} | |}} | ||
|- | <!-- Birthday row - only display if birthday is provided --> | ||
|- {{#if: {{{birthday|}}} | style="vertical-align:top;" | |||
! Born: | ! Born: | ||
{{!}} {{{birthday}}} | |||
|- {{#if: {{{team|}}} | | {{!}}- | ||
|}} | |||
<!-- Team row - only display if team is provided --> | |||
|- {{#if: {{{team|}}} | style="vertical-align:top;" | |||
! Team: | ! Team: | ||
{{!}} {{{team | {{!}} {{{team}}} | ||
{{!}}- | {{!}}- | ||
|}} | |}} | ||
<!-- Favorite car row - only display if favoritecar or Favorite_car is provided --> | |||
<!-- Favorite car | |- {{#if: {{{favoritecar|{{{Favorite_car|}}}}}} | style="vertical-align:top;" | ||
{{#if:{{{favoritecar| | ! Favorite car: | ||
{{!}} {{{favoritecar|{{{Favorite_car|}}}}}} | |||
{{!}}- | |||
{{!}} {{ | |}} | ||
}} | <!-- Car color row - only display if carcolor or color_car is provided --> | ||
|- {{#if: {{{carcolor|{{{color_car|}}}}}} | style="vertical-align:top;" | |||
<!-- | ! Car color: | ||
{{#if:{{{carcolor| | {{!}} <span style="display:inline-block;width:1.2em;height:1.2em;border:1px solid #aaa;vertical-align:middle;background:{{{carcolor|{{{color_car|}}}}}};"></span> {{{carcolor|{{{color_car|}}}}}} | ||
{{!}}- | |||
|}} | |||
{{!}} <span style="display:inline-block;width:1.2em;height:1.2em;border:1px solid #aaa;vertical-align:middle;background | <!-- First race row - only display if firstrace is provided --> | ||
}} | |- {{#if: {{{firstrace|}}} | style="vertical-align:top;" | ||
|- | |||
! First race: | ! First race: | ||
{{!}} {{{firstrace}}} | |||
|- {{#if: {{{results|}}} | | {{!}}- | ||
|}} | |||
<!-- Championship titles row - only display if results is provided --> | |||
|- {{#if: {{{results|}}} | style="vertical-align:top;" | |||
! Championship titles: | ! Championship titles: | ||
{{!}} {{{results| | {{!}} {{{results}}} | ||
{{!}}- | |||
|}} | |||
<!-- Footnotes row - only display if footnotes is provided --> | |||
|- {{#if: {{{footnotes|}}} | | |||
{{!}} colspan="2" style="font-size: smaller;" {{!}} {{{footnotes}}} | |||
{{!}}- | {{!}}- | ||
|}} | |}} | ||
|} | |} | ||
{{#if: {{NAMESPACE}} ||[[Category:Racers{{!}}{{PAGENAME}}]]}} | {{#if: {{NAMESPACE}} ||[[Category:Racers{{!}}{{PAGENAME}}]]}} | ||
| Line 61: | Line 71: | ||
birthday = 1980-11-05| | birthday = 1980-11-05| | ||
team = Meganium Aces High| | team = Meganium Aces High| | ||
favoritecar = | favoritecar = Melange| | ||
carcolor = Yellow| | carcolor = Yellow| | ||
firstrace = ZCT14 (May 2002)| | firstrace = ZCT14 (May 2002)| | ||
Latest revision as of 21:15, 18 August 2025
Usage example on the right.

