Difference between revisions of "Template:Infobox game"
(improved WSGF Link handling (storing in #var instead of repeating #show)) |
m (changed cargo_query to a subtemplate instead) |
||
(47 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <table class="vertical-navbox template-infobox" id="infobox-game"> | + | {{Assignment/checkAvailable|{{PAGENAME}}}}<!-- |
− | <caption class="template-infobox-title">{{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}<includeonly> | + | --><table class="vertical-navbox template-infobox" id="infobox-game"> |
− | + | <caption class="template-infobox-title">{{#if:{{{title|}}}|{{{title}}}|{{PAGENAME}}}}<includeonly></includeonly></caption> | |
− | {{#if: {{{cover|}}} | | + | <includeonly>{{#if: {{{cover|}}} | |
<tr> | <tr> | ||
− | <td class="template-infobox-cover" colspan="2"> | + | <td class="template-infobox-cover" colspan="2">{{#ifexist: File:{{{cover}}} | [[File:{{{cover}}}{{!}}{{{cover size|300px}}}{{!}}alt={{{title|{{PAGENAME}}}}} cover]]{{#set:|Cover={{filepath:{{{cover}}}}}|Cover filename=File:{{{cover}}}}} |''Cover image missing, please <span class="plainlinks">[https://pcgamingwiki.com/w/index.php?title=Special:Upload&wpDestFile={{urlencode:{{{cover}}}|WIKI}} upload it]</span>''[[Category:Pages needing cover images]]}}</td> |
</tr> | </tr> | ||
− | }} | + | |[[Category:Pages needing cover images]]}}</includeonly> |
{{#if: {{{developers|}}} | | {{#if: {{{developers|}}} | | ||
Line 38: | Line 38: | ||
{{{release dates|}}}|<includeonly>{{#ifeq: {{NAMESPACE}} | | [[Category:Pages with no release dates]] }}</includeonly> | {{{release dates|}}}|<includeonly>{{#ifeq: {{NAMESPACE}} | | [[Category:Pages with no release dates]] }}</includeonly> | ||
}} | }} | ||
− | + | <!-- checking DOSBox-only status -->{{#if: {{#var:Windows DOSBox}}{{#var:OS X DOSBox}}{{#var:Linux DOSBox}}|<!-- | |
− | <!-- Icons --> | + | -->{{#if: {{#var:Windows native}}|{{#vardefine:Windows DOSBox|}}}}<!-- |
− | <!-- storing WSGF Link state -->{{#vardefine:WSGF Link|{{#show: {{PAGENAME}} | ?WSGF Link}}}}<-- | + | -->{{#if: {{#var:OS X native}}|{{#vardefine:OS X DOSBox|}}}}<!-- |
− | -->{{#if: {{{wikipedia|}}}{{{steam appid|}}}{{{winehq|}}}{{{strategywiki|}}}{{#var:WSGF Link}}| | + | -->{{#if: {{#var:Linux native}}|{{#vardefine:Linux DOSBox|}}}}<!-- |
+ | -->}}<!-- | ||
+ | Icons --> | ||
+ | <!-- storing WSGF Link state -->{{#vardefine:WSGF Link|{{#show: {{PAGENAME}} | ?WSGF Link #}}}}<!-- | ||
+ | storing IsThereAnyDeal ID -->{{#if:{{{steam appid|}}}|{{#ifeq: {{#get_web_data:url=https://api.isthereanydeal.com/v02/game/plain/?key=ITAD_KEY&shop=steam&game_id=app/{{{steam appid|}}}|format=JSON|data=itad=data}}|<span class="error">Error: No contents found at URL <a rel="nofollow" class="external free" href="https://api.isthereanydeal.com/v02/game/plain/?key=ITAD_KEY&shop=steam&game_id=app/{{{steam appid|}}}">https://api.isthereanydeal.com/v02/game/plain/?key=ITAD_KEY&shop=steam&game_id=app/{{{steam appid|}}}</a>.</span>||{{#ifeq:{{#external_value:itad}}|<span class="error">Error: no local variable "itad" was set.</span>||{{#vardefine:ITAD match|{{#external_value:itad}}}}}}}}}}{{#if:{{#var:ITAD match}}||{{#vardefine:ITAD match|{{#show: {{PAGENAME}} | ?IsThereAnyDeal ID}}}}}}<!-- | ||
+ | -->{{#if: {{{wikipedia|}}}{{{gogcom id|}}}{{{steam appid|}}}{{{winehq|}}}{{{strategywiki|}}}{{#var:WSGF Link}}{{#var:ITAD match}}| | ||
<tr> | <tr> | ||
<td class="template-infobox-icons" colspan="2"><!-- | <td class="template-infobox-icons" colspan="2"><!-- | ||
− | -->{{#if: {{{winehq|}}} | <div title="{{PAGENAME}} | + | -->{{#if: {{{winehq|}}} | <div title="{{PAGENAME}} on WineHQ" class="plainlinks template-infobox-icon svg-icon infobox-winehq">[https://appdb.winehq.org/objectManager.php?sClass=application&iId={{{winehq}}} ]</div>}}<!-- |
− | -->{{#if: {{#var:WSGF Link}} | <div title="{{PAGENAME}} | + | -->{{#if: {{#var:WSGF Link}} | <div title="{{PAGENAME}} on WSGF" class="plainlinks template-infobox-icon svg-icon infobox-wsgf">[{{#var:WSGF Link}} ]</div> }}<!-- |
+ | -->{{#if: {{{gogcom id|}}} | <div title="{{PAGENAME}} in GOG Database" class="plainlinks template-infobox-icon svg-icon infobox-gogdb">[https://www.gogdb.org/product/{{{gogcom id|}}} ]</div> {{#if:{{#var:Windows DOSBox}}{{#var:OS X DOSBox}}{{#var:Linux DOSBox}}|{{#ifeq:{{#show: {{PAGENAME}} | ?Cloud support GOG Galaxy}}|true|{{#vardefine:GOG.com DOSBox cloud|true}}}}}}}}<!-- | ||
-->{{#if: {{{steam appid|}}} | {{#ifeq: {{#get_web_data: | -->{{#if: {{{steam appid|}}} | {{#ifeq: {{#get_web_data: | ||
url=http://m.co-optimus.com/api/games.php?search=true&steamid={{{steam appid|}}}&json=true | url=http://m.co-optimus.com/api/games.php?search=true&steamid={{{steam appid|}}}&json=true | ||
|format=JSON | |format=JSON | ||
|data=coopgameid=gameid,coopurl=urlSlug | |data=coopgameid=gameid,coopurl=urlSlug | ||
− | }} | <span class="error">Error: Invalid JSON.</span> ||<div title="{{PAGENAME}} | + | }} | <span class="error">Error: Invalid JSON.</span> ||<div title="{{PAGENAME}} on Co-Optimus" class="plainlinks template-infobox-icon svg-icon infobox-cooptimus">[https://www.co-optimus.com/game/{{#external_value:coopgameid}}/pc/{{#external_value:coopurl}}.html ]</div>}}<div title="{{PAGENAME}} on SteamDB" class="plainlinks template-infobox-icon svg-icon infobox-steamdb">[https://steamdb.info/app/{{{steam appid|}}}/ ]</div> }}<!-- |
− | -->{{#if: {{{strategywiki|}}} | <div title="{{PAGENAME}} guide | + | -->{{#if: {{#var:ITAD match}} | <div title="{{PAGENAME}} on IsThereAnyDeal" class="plainlinks template-infobox-icon svg-icon infobox-itad">[https://isthereanydeal.com/game/{{#var:ITAD match}}/info/ ]</div>{{#vardefine:ITAD match|}}}}<!-- |
− | -->{{#if: {{{wikipedia|}}} | <div title="{{PAGENAME}} | + | -->{{#if: {{{strategywiki|}}} | <div title="{{PAGENAME}} guide on StrategyWiki" class="template-infobox-icon svg-icon infobox-strategywiki">[[File:Icon overlay.png|link=strategywiki:{{{strategywiki}}}|{{PAGENAME}} guide on StrategyWiki]]</div>}}<!-- |
+ | -->{{#if: {{{wikipedia|}}} | <div title="{{PAGENAME}} on Wikipedia" class="template-infobox-icon svg-icon infobox-wikipedia">[[File:Icon overlay.png|link=Wikipedia:{{{wikipedia}}}|{{PAGENAME}} on Wikipedia]]</div> }}</td> | ||
</tr> | </tr> | ||
}}<!-- Hidden properties | }}<!-- Hidden properties | ||
Line 58: | Line 65: | ||
-->{{#if: {{{steam appid side|}}}| {{#ifeq: {{{steam appid|}}}||[[Category:Invalid template usage (infobox game)]]}}{{#arraymap:{{{steam appid side|}}}|,|var|[[Steam AppID::var| ]]| }} }}<!-- | -->{{#if: {{{steam appid side|}}}| {{#ifeq: {{{steam appid|}}}||[[Category:Invalid template usage (infobox game)]]}}{{#arraymap:{{{steam appid side|}}}|,|var|[[Steam AppID::var| ]]| }} }}<!-- | ||
-->{{#if: {{{winehq|}}}| [[WineHQ AppID::{{{winehq}}}| ]] }}<!-- | -->{{#if: {{{winehq|}}}| [[WineHQ AppID::{{{winehq}}}| ]] }}<!-- | ||
− | -->{{#if: {{{gogcom page|}}}| {{#arraymap:{{{gogcom | + | -->{{#if: {{{gogcom id|}}}| [[GOGcom page::{{{gogcom id}}}| ]][[GOGcom ID::{{{gogcom id}}}| ]] {{#vardefine:gogcom id|{{{gogcom id}}}}} }}<!-- |
+ | -->{{#if: {{{gogcom id side|}}}| {{#arraymap:{{{gogcom id side|}}}|,|var|[[GOGcom page::var| ]][[GOGcom ID::var| ]]| }} }}<!-- | ||
-->{{#if: {{{strategywiki|}}}| [[StrategyWiki::{{{strategywiki}}}| ]] }}<!-- | -->{{#if: {{{strategywiki|}}}| [[StrategyWiki::{{{strategywiki}}}| ]] }}<!-- | ||
-->{{#if: {{{wikipedia|}}}| [[Wikipedia::{{{wikipedia}}}| ]] }}<!-- | -->{{#if: {{{wikipedia|}}}| [[Wikipedia::{{{wikipedia}}}| ]] }}<!-- | ||
− | --></table><noinclude>{{Documentation}}</noinclude> | + | -->{{#if: {{{license|}}}| {{Infobox game/license|{{lc:{{{license|}}}}}}} }}<!-- |
+ | -->{{#vardefine:VR|{{#show: {{PAGENAME}} | ?VR only}}}}<!-- | ||
+ | -->{{#ifeq: {{#var:PC booter}}{{#var:DOS}}{{#var:Windows 3.x}}{{#var:Windows}}{{#var:Mac OS}}{{#var:OS X}}{{#var:Linux}}|true||{{#vardefine:OS tabs|true}}}}<!-- | ||
+ | -->{{#ifeq: {{#var:PC booter}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:DOS}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:Windows 3.x}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:Windows}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:Mac OS}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:OS X}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#ifeq: {{#var:Linux}} | ported | [[Category:Invalid template usage (infobox game)]]}}<!-- | ||
+ | -->{{#if: {{{gogcom page|}}} | [[Category:Invalid template usage (infobox game)]]}}</table><!-- | ||
+ | -->{{#if:{{#var:Windows 3.x}}|{{#if:{{#var:Windows native}}||{{#vardefine:Warnings|true}} }}}}<!-- | ||
+ | -->{{#if:{{#show: {{PAGENAME}} | ?Warnings}}|{{#vardefine:Top warnings|true}}{{#vardefine:Top last|Infobox}}{{#vardefine:Top|{{#show: {{PAGENAME}} | ?Top}}}}{{#vardefine:DRM|{{#show: {{PAGENAME}} | ?Uses DRM}}}}{{#ifeq:{{#var:Top}}|Infobox|{{Warnings}}}}}}<noinclude>{{#cargo_declare: | ||
+ | _table=Infobox_game | ||
+ | |Cover=File | ||
+ | |Cover_URL=URL | ||
+ | |Steam_AppID=List (,) of String | ||
+ | |WineHQ_AppID=String | ||
+ | |GOGcom_page=List (,) of String | ||
+ | |StrategyWiki=String | ||
+ | |Wikipedia=String | ||
+ | |License=String | ||
+ | }}</noinclude><includeonly>{{#ifeq: {{NAMESPACE}} | | [[Category:Games]]{{#vardefine:Game|true}}{{#cargo_store: | ||
+ | _table=Infobox_game | ||
+ | |Cover={{#ifexist: File:{{{cover}}}|{{{cover|}}}|}} | ||
+ | |Cover_URL={{filepath:{{{cover|}}}}} | ||
+ | |Steam_AppID={{{steam appid|}}} | ||
+ | |Steam_AppID={{{steam appid side|}}} | ||
+ | |WineHQ_AppID={{{winehq|}}} | ||
+ | |GOGcom_page={{{gogcom id|}}} | ||
+ | |GOGcom_page={{{gogcom id side|}}} | ||
+ | |StrategyWiki={{{strategywiki|}}} | ||
+ | |Wikipedia={{{wikipedia|}}} | ||
+ | |License={{{license|}}} | ||
+ | }}|}}</includeonly><noinclude>{{Documentation}}</noinclude> |
Revision as of 01:28, 10 November 2019
This template defines the table "Infobox_game". View table.
{{#set:|Cover=https://images.pcgamingwiki.com/9/99/Game_article_layout.jpg%7CCover filename=File:Game article layout.jpg}} | |
Developers | |
---|---|
Developer | |
Windows | Developer 2 |
macOS (OS X) | Developer 3 |
Linux | Developer 4 |
Publishers | |
Publisher | |
Europe | Publisher 2 |
Engines | |
Engine | |
Release dates | |
DOS | June 12, 1996 |
Mac OS (Classic) | July 4, 1998 |
Windows | January 3, 2012 |
macOS (OS X) | March 21, 2013 |
Linux | Early access |
This template needs to be present on every game page on the wiki. It contains the basic information on who developed, ported and published the game, as well as what engine was used and when was it released on different operating systems. In addition, it can hold a cover or box image for the game, as well as information on the location of the game's page on several other websites.
- Syntax
{{Infobox game |cover = |developers = {{Infobox game/row/developer|}} {{Infobox game/row/porter|}} |publishers = {{Infobox game/row/publisher|}} |engines = {{Infobox game/row/engine|}} |release dates= {{Infobox game/row/date|Windows|}} {{Infobox game/row/date|OS X|}} {{Infobox game/row/date|Linux|}} |reception = {{Infobox game/row/reception|Metacritic| | }} {{Infobox game/row/reception|OpenCritic| | }} {{Infobox game/row/reception|IGDB| | }} |taxonomy = {{Infobox game/row/taxonomy/monetization | }} {{Infobox game/row/taxonomy/microtransactions | }} {{Infobox game/row/taxonomy/modes | }} {{Infobox game/row/taxonomy/pacing | }} {{Infobox game/row/taxonomy/perspectives | }} {{Infobox game/row/taxonomy/controls | }} {{Infobox game/row/taxonomy/genres | }} {{Infobox game/row/taxonomy/sports | }} {{Infobox game/row/taxonomy/vehicles | }} {{Infobox game/row/taxonomy/art styles | }} {{Infobox game/row/taxonomy/themes | }} {{Infobox game/row/taxonomy/series | }} |steam appid = |steam appid side = |gogcom id = |gogcom id side = |official site= |hltb = |igdb = <!-- Only needs to be set if there is no IGDB reception row --> |lutris = |mobygames = |strategywiki = |wikipedia = |winehq = |license = }}
- Arguments
Parameter | Description |
---|---|
title | Optional. Add if game title is stylized in some way and therefore varies from page name. |
cover | Only include this if a cover for this game is present on the wiki or on Wikimedia Commons. The contents of this line should be just the filename, excluding the namespace. Do not use a File: prefix for it, and do not use the {{Image}} template for it.
|
developers | All information included under this argument must be related to developers of the particular game.
Possible rows include:
|
publishers | This row should only be used when a game was published by a company other than the developer of the game.
Possible rows include:
|
engines | All information included under this argument must be related to engines used in the game.
Possible rows include:
See the {{Infobox game/row/engine}} documentation for more details, including on how to optionally specify the exact engine version used. |
release dates | All information included under this argument must be related to release dates of the game.
Possible rows include:
See the {{Infobox game/row/date}} documentation for more details. |
reception | Average (based on a minimum of at least 4 scored reviews) critics reception of the game from a supported aggregator.
Possible rows include:
|
taxonomy | The appropriate taxonomy tags for the game, see Taxonomy for further information. |
steam appid | The App ID of the game on Steam. The SteamDB favicon will appear when it is defined.
|
steam appid side | Additional App IDs the game or its DLCs are available under on Steam. This takes a comma separated list for input.
|
gogcom id | The ID of the game on GOG.com. The GOG Database favicon will appear when it is defined. |
gogcom id side | Additional IDs the game or its DLCs/packages are available under on GOG.com. This takes a comma separated list for input. |
official site | Add the full URL of the official site from either the original developer or the current rights holder. Do not use store pages. |
winehq | The unique link identifier for the game on WineHQ. |
hltb | The unique link identifier for the game on HowLongToBeat.
|
igdb | The unique link identifier for the game on IGDB.
This only needs to be filled out if a reception row for IGDB is not present already. |
lutris | The unique link identifier for the game on Lutris.
|
mobygames | The unique link identifier for the game on MobyGames.
|
strategywiki | The unique link identifier for the game on StrategyWiki.
|
wikipedia | The unique link identifier for the game on the English Wikipedia. The Wikipedia favicon will appear when it is defined.
|
license | License of the game from one of the following values. This information is not shown on the game page but is used to populate other pages such as the List of freeware games.
|