More actions
Obbybigfast (talk | contribs) capitalization |
Added dynamic categorization |
||
(16 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<!-- Params: | |||
trackId = required (MX TrackId) | |||
site = tmnf | tmuf | original | sunrise | nations (default: tmnf) | |||
title, image, game = optional manual overrides (Game stays manual) | |||
--> | |||
{{#if:{{{trackId|}}} | |||
| {{#get_web_data: | |||
| url = {{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = https://tmuf.exchange | |||
| tmnf = https://tmnf.exchange | |||
| original = https://original.tm-exchange.com | |||
| sunrise = https://sunrise.tm-exchange.com | |||
| nations = https://nations.tm-exchange.com | |||
| #default = https://tmnf.exchange | |||
}}/api/tracks?id={{{trackId}}}&count=1&fields=TrackId%2CTrackName%2CUId%2CAuthorTime%2CAuthorScore%2CGoldTarget%2CSilverTarget%2CBronzeTarget%2CUploader.UserId%2CUploader.Name%2CAuthors%5B%5D%2CWRReplay.ReplayTime%2CWRReplay.User.Name%2CUploadedAt%2CUpdatedAt%2CActivityAt%2CPrimaryType%2CTrackValue%2CStyle%2CRoutes%2CDifficulty%2CEnvironment%2CCar%2CMood%2CAwards%2CComments%2CReplayType | |||
| format = json with jsonpath | |||
| cache seconds = 300 | |||
| data = | |||
id = $.Results[0].TrackId, | |||
name = $.Results[0].TrackName, | |||
uid = $.Results[0].UId, | |||
time_author = $.Results[0].AuthorTime, | |||
score_author = $.Results[0].AuthorScore, | |||
time_gold = $.Results[0].GoldTarget, | |||
time_silver = $.Results[0].SilverTarget, | |||
time_bronze = $.Results[0].BronzeTarget, | |||
uploader_id = $.Results[0].Uploader.UserId, | |||
uploader_name = $.Results[0].Uploader.Name, | |||
wr_time = $.Results[0].WRReplay.ReplayTime, | |||
wr_player = $.Results[0].WRReplay.User.Name, | |||
uploaded_at = $.Results[0].UploadedAt, | |||
updated_at = $.Results[0].UpdatedAt, | |||
activity_at = $.Results[0].ActivityAt, | |||
primary_type = $.Results[0].PrimaryType, | |||
track_value = $.Results[0].TrackValue, | |||
style = $.Results[0].Style, | |||
routes = $.Results[0].Routes, | |||
difficulty = $.Results[0].Difficulty, | |||
environment = $.Results[0].Environment, | |||
car = $.Results[0].Car, | |||
mood = $.Results[0].Mood, | |||
awards = $.Results[0].Awards, | |||
comments = $.Results[0].Comments, | |||
replay_type = $.Results[0].ReplayType, | |||
authors_json = $.Results[0].Authors[*].User.Name | |||
}} | |||
}} | |||
{| class="wikitable infobox-track" style="width:300px; float:right; clear:right; margin-left:10px;" | {| class="wikitable infobox-track" style="width:300px; float:right; clear:right; margin-left:10px;" | ||
|- | |- | ||
! colspan="2" class="infobox-title" | {{{title|{{ | ! colspan="2" class="infobox-title" | {{#if:{{{title|}}} | ||
| {{{title}}} | |||
| {{#if:{{#external_value:name|}} | |||
| {{#external_value:name}} | |||
| Unknown }} }} | |||
|- | |||
| colspan="2" class="infobox-image" | {{ShowImage|https://{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = tmuf.exchange | |||
| tmnf = tmnf.exchange | |||
| original = original.tm-exchange.com | |||
| sunrise = sunrise.tm-exchange.com | |||
| nations = nations.tm-exchange.com | |||
| #default = tmnf.exchange | |||
}}/trackshow/{{#external_value:id}}/image/1}} | |||
|- | |||
! Game || {{{game|{{#switch: {{lc:{{{site|}}}}} | |||
| tmuf = TrackMania United Forever | |||
| tmnf = TrackMania Nations Forever | |||
| original = TrackMania Original | |||
| sunrise = TrackMania Sunrise | |||
| nations = TrackMania Nations | |||
| #default = TrackMania Nations Forever | |||
}}}}} | |||
|- | |- | ||
| | ! Author(s) || {{#if:{{{author|}}} | ||
| {{{author}}} | |||
| {{#if:{{#external_value:authors_json|}} | |||
| {{#external_value:authors_json}} | |||
| Unknown | |||
}} }} | |||
|- | |||
! World record || {{#if:{{{worldrecord|}}} | |||
| {{{worldrecord}}} | |||
| {{#invoke:TrackInfobox|formatWR | |||
| {{#external_value:wr_time|}} | |||
| {{#external_value:wr_player|}} | |||
| Unknown | |||
}} | |||
}} | |||
|- | |- | ||
! | ! Author medal || {{#if:{{{authormedal|}}} | ||
| {{{authormedal}}} | |||
| {{#if:{{#external_value:time_author|}} | |||
| {{#expr: {{#external_value:time_author}} / 1000 }} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Gold medal || {{#if:{{{goldmedal|}}} | ||
| {{{goldmedal}}} | |||
| {{#if:{{#external_value:time_gold|}} | |||
| {{#expr: {{#external_value:time_gold}} / 1000 }} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Silver medal || {{#if:{{{silvermedal|}}} | ||
| {{{silvermedal}}} | |||
| {{#if:{{#external_value:time_silver|}} | |||
| {{#expr: {{#external_value:time_silver}} / 1000 }} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Bronze medal || {{#if:{{{bronzemedal|}}} | ||
| {{{bronzemedal}}} | |||
| {{#if:{{#external_value:time_bronze|}} | |||
| {{#expr: {{#external_value:time_bronze}} / 1000 }} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Uploaded || {{#if:{{{release_date|}}} | ||
| {{{release_date}}} | |||
| {{#if:{{#external_value:uploaded_at|}} | |||
| {{#external_value:uploaded_at}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Last updated || {{#if:{{{lastupdated|}}} | ||
| {{{lastupdated}}} | |||
| {{#if:{{#external_value:updated_at|}} | |||
| {{#external_value:updated_at}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Activity || {{#if:{{{activity|}}} | ||
| {{{activity}}} | |||
| {{#if:{{#external_value:activity_at|}} | |||
| {{#external_value:activity_at}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! | ! Awards / Comments || {{#if:{{{awardscomments|}}} | ||
| {{{awardscomments}}} | |||
| {{#if:{{#external_value:awards|dummy}} | |||
| {{#external_value:awards|0}} / {{#external_value:comments|0}} | |||
| N/A | |||
}} }} | |||
|- | |- | ||
! Link || {{{link|Unknown}}} | ! Link || {{#if:{{{link|}}} | ||
| {{{link}}} | |||
| {{#if:{{#external_value:id|{{{trackId|}}}}} | |||
| [{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = https://tmuf.exchange | |||
| tmnf = https://tmnf.exchange | |||
| original = https://original.tm-exchange.com | |||
| sunrise = https://sunrise.tm-exchange.com | |||
| nations = https://nations.tm-exchange.com | |||
| #default = https://tmnf.exchange | |||
}}/trackshow/{{#external_value:id|{{{trackId|}}}}} TrackMania Exchange] | |||
| Unknown | |||
}} }} | |||
|- | |- | ||
|} | |} | ||
[[Category: | [[Category:{{uc:{{{site|tmnf}}}}} Tracks]] | ||
[[Category:Tracks|{{PAGENAME}}]] | |||
[[Category:{{#switch:{{lc:{{{site|tmnf}}}}} | |||
| tmuf = TMUF | |||
| tmnf = TMNF | |||
| original = TMO | |||
| sunrise = TMS | |||
| nations = TMN | |||
| #default = TMNF | |||
}} Tracks|{{PAGENAME}}]] | |||
</includeonly><noinclude> | </includeonly><noinclude> | ||
== Usage == | == Usage == | ||
This is the infobox template for | This is the infobox template for tracks. To use it, copy and paste the following code into an article (trackId is required, site is tmnf by default): | ||
<pre> | <pre> | ||
{{Infobox | {{Infobox track | ||
| title = Track Title | | trackId = 123456 | ||
| image = Example.jpg | | site = tmuf, tmnf, original, sunrise, nations (Default: tmnf) | ||
| game = TrackMania Game | | title = Track Title (Optional) | ||
| image = Example.jpg (Optional) | |||
| game = TrackMania Game (Optional) | |||
}} | }} | ||
</pre> | </pre> |
Latest revision as of 21:43, 14 August 2025
Usage[edit]
This is the infobox template for tracks. To use it, copy and paste the following code into an article (trackId is required, site is tmnf by default):
{{Infobox track | trackId = 123456 | site = tmuf, tmnf, original, sunrise, nations (Default: tmnf) | title = Track Title (Optional) | image = Example.jpg (Optional) | game = TrackMania Game (Optional) }}