Difference between revisions of "Template:Availability/store"

From PCGamingWiki, the wiki about fixing PC games
(bethesda fix)
m (streamlined the process a bit using variables and perform the property assignment at the end instead + added support for assigning new property, Available from historically, and changed Available from to only be assigned if release is available)
 
Line 1: Line 1:
 
{{#switch:{{lc:{{{1}}}}}
 
{{#switch:{{lc:{{{1}}}}}
 
|amazon
 
|amazon
|amazon.com = [https://amazon.com/dp/{{{link}}}?tag=pcgamingwik0e-20 Amazon.com][[Available from::Amazon.com| ]]{{#vardefine:store|Amazon}}
+
|amazon.com = [https://amazon.com/dp/{{{link}}}?tag=pcgamingwik0e-20 Amazon.com]{{#vardefine:store|Amazon}}{{#vardefine:store property value|Amazon.com}}
|amazon.co.uk = [https://amazon.co.uk/dp/{{{link}}}?tag=pcgamingwiki-21 Amazon.co.uk][[Available from::Amazon.co.uk| ]]{{#vardefine:store|Amazon UK}}
+
|amazon.co.uk = [https://amazon.co.uk/dp/{{{link}}}?tag=pcgamingwiki-21 Amazon.co.uk]{{#vardefine:store|Amazon UK}}{{#vardefine:store property value|Amazon.co.uk}}
|battle.net = [https://shop.battle.net/product/{{{link}}} Battle.net][[Available from::Battle.net| ]] {{#vardefine:store|Battlenet}}
+
|battle.net = [https://shop.battle.net/product/{{{link}}} Battle.net]{{#vardefine:store|Battlenet}}{{#vardefine:store property value|Battle.net}}
|bethesda.net = [https://bethesda.net/en/store/product/{{{link}}} Bethesda.net][[Available from::Bethesda.net| ]]{{#vardefine:store|Bethesdanet}}
+
|bethesda.net = [https://bethesda.net/en/store/product/{{{link}}} Bethesda.net]{{#vardefine:store|Bethesdanet}}{{#vardefine:store property value|Bethesda.net}}
|discord = [https://discordapp.com/store/skus/{{{link}}} Discord][[Available from::Discord| ]]{{#vardefine:Discord|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Discord}}
+
|discord = [https://discordapp.com/store/skus/{{{link}}} Discord]{{#vardefine:Discord|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Discord}}{{#vardefine:store property value|Discord}}
|epic games store = [https://store.epicgames.com/pcgamingwiki/{{{link}}} Epic Games Store][[Available from::Epic Games Store| ]]{{#vardefine:Epic Games Store|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Epic Games Store}}[[Epic Games Store ID::{{{link}}}| ]]
+
|epic games store = [https://store.epicgames.com/pcgamingwiki/{{{link}}} Epic Games Store]{{#vardefine:Epic Games Store|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Epic Games Store}}[[Epic Games Store ID::{{{link}}}| ]]{{#vardefine:store property value|Epic Games Store}}
|epic games store subpage = [https://www.epicgames.com/store/product/{{{link}}}?epic_affiliate=pcgamingwiki Epic Games Store][[Available from::Epic Games Store| ]]{{#vardefine:Epic Games Store|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Epic Games Store}}[[Epic Games Store ID::{{{link}}}| ]]
+
|epic games store subpage = [https://www.epicgames.com/store/product/{{{link}}}?epic_affiliate=pcgamingwiki Epic Games Store]{{#vardefine:Epic Games Store|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Epic Games Store}}[[Epic Games Store ID::{{{link}}}| ]]{{#vardefine:store property value|Epic Games Store}}
|gamersgate = [http://www.dpbolvw.net/click-6723194-10912384?url=http://www.gamersgate.com/{{{link}}}?caff=5418682 GamersGate][[Available from::GamersGate| ]]{{#vardefine:store|GamersGate}}
+
|gamersgate = [http://www.dpbolvw.net/click-6723194-10912384?url=http://www.gamersgate.com/{{{link}}}?caff=5418682 GamersGate]{{#vardefine:store|GamersGate}}{{#vardefine:store property value|GamersGate}}
|gamesplanet = [https://gamesplanet.com/game/{{{link}}}?ref=pcgwiki Gamesplanet][[Available from::Gamesplanet| ]]{{#vardefine:store|Gamesplanet}}
+
|gamesplanet = [https://gamesplanet.com/game/{{{link}}}?ref=pcgwiki Gamesplanet]{{#vardefine:store|Gamesplanet}}{{#vardefine:store property value|Gamesplanet}}
 
|gog.com
 
|gog.com
|gog = [https://www.gog.com/game/{{{link}}}?pp=708a77db476d737e54b8bf4663fc79b346d696d2 GOG.com][[Available from::GOG.com| ]][[GOGcom page::{{{link}}}| ]]{{#if:{{#var:gogcom id}}||{{#vardefine:gogcom id|unknown}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|GOGcom}}
+
|gog = [https://www.gog.com/game/{{{link}}}?pp=708a77db476d737e54b8bf4663fc79b346d696d2 GOG.com][[GOGcom page::{{{link}}}| ]]{{#if:{{#var:gogcom id}}||{{#vardefine:gogcom id|unknown}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|GOGcom}}{{#vardefine:store property value|GOG.com}}
|gmg = [https://www.dpbolvw.net/click-6723194-10912384?url=https://www.greenmangaming.com/games/{{{link}}} Green Man Gaming][[Available from::Green Man Gaming| ]]{{#vardefine:store|Green Man Gaming}}
+
|gmg = [https://www.dpbolvw.net/click-6723194-10912384?url=https://www.greenmangaming.com/games/{{{link}}} Green Man Gaming]{{#vardefine:store|Green Man Gaming}}{{#vardefine:store property value|Green Man Gaming}}
 
|humble store
 
|humble store
|humble = [https://www.humblebundle.com/store/{{{link}}}?partner=pcgw Humble Store][[Available from::Humble Store| ]]{{#vardefine:store|Humble Store}}[[Humble Store ID::{{{link}}}| ]]
+
|humble = [https://www.humblebundle.com/store/{{{link}}}?partner=pcgw Humble Store]{{#vardefine:store|Humble Store}}[[Humble Store ID::{{{link}}}| ]]{{#vardefine:store property value|Humble Store}}
|itch.io = [{{{link}}}?ac=Q8uS8a4hVvG itch.io][[Available from::itch.io| ]]{{#vardefine:store|itchio}}
+
|itch.io = [{{{link}}}?ac=Q8uS8a4hVvG itch.io]{{#vardefine:store|itchio}}{{#vardefine:store property value|itch.io}}
 
|macapp
 
|macapp
|mac app store = [https://apps.apple.com/app/{{{link}}} Mac App Store][[Available from::Mac App Store| ]]{{#vardefine:store|Mac App Store}}
+
|mac app store = [https://apps.apple.com/app/{{{link}}} Mac App Store]{{#vardefine:store|Mac App Store}}{{#vardefine:store property value|Mac App Store}}
|microsoft store = [http://microsoft.msafflnk.net/c/1395635/465310/7794?prodsku={{{link}}}&u=https://www.microsoft.com/store/apps/{{{link}}} Microsoft Store][[Available from::Microsoft Store| ]]{{#vardefine:store|Microsoft Store}}
+
|microsoft store = [http://microsoft.msafflnk.net/c/1395635/465310/7794?prodsku={{{link}}}&u=https://www.microsoft.com/store/apps/{{{link}}} Microsoft Store]{{#vardefine:store|Microsoft Store}}{{#vardefine:store property value|Microsoft Store}}
 
|oculus
 
|oculus
|oculus store = [https://www.oculus.com/experiences/rift/{{{link}}}/ Oculus Store][[Available from::Oculus Store| ]]{{#vardefine:store|Oculus Store}}
+
|oculus store = [https://www.oculus.com/experiences/rift/{{{link}}}/ Oculus Store]{{#vardefine:store|Oculus Store}}{{#vardefine:store property value|Oculus Store}}
|origin = [https://www.origin.com/usa/en-us/store/{{{link}}} Origin][[Available from::Origin| ]]{{#vardefine:Origin|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Origin}}
+
|origin = [https://www.origin.com/usa/en-us/store/{{{link}}} Origin]{{#vardefine:Origin|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Origin}}{{#vardefine:store property value|Origin}}
|steam = [https://store.steampowered.com/app/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam][[Available from::Steam| ]]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}
+
|steam = [https://store.steampowered.com/app/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}{{#vardefine:store property value|Steam}}
|steam-sub = [https://store.steampowered.com/sub/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam][[Available from::Steam| ]]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}
+
|steam-sub = [https://store.steampowered.com/sub/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}{{#vardefine:store property value|Steam}}
|steam-bundle = [https://store.steampowered.com/bundle/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam][[Available from::Steam| ]]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}
+
|steam-bundle = [https://store.steampowered.com/bundle/{{{link}}}/?utm_source=PCGamingWiki&utm_medium=PCGamingWiki&utm_campaign=PCGamingWiki Steam]{{#if:{{#var:steam appid}}||{{#vardefine:steam appid|{{{link}}}}}{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }} }}{{#vardefine:cloud|needed}}{{#vardefine:store|Steam}}{{#vardefine:store property value|Steam}}
|twitch = [https://www.twitch.tv/directory/game/{{{link}}}/details Twitch][[Available from::Twitch| ]]{{#vardefine:store|Twitch}}
+
|twitch = [https://www.twitch.tv/directory/game/{{{link}}}/details Twitch]{{#vardefine:store|Twitch}}{{#vardefine:store property value|Twitch}}
|uplay = [http://www.dpbolvw.net/click-6723194-10912384?url=http://store.ubi.com/{{{link}}}.html Uplay][[Available from::Uplay| ]]{{#vardefine:Uplay|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Uplay}}
+
|uplay = [http://www.dpbolvw.net/click-6723194-10912384?url=http://store.ubi.com/{{{link}}}.html Uplay]{{#vardefine:Uplay|true}}{{#vardefine:cloud|needed}}{{#vardefine:store|Uplay}}{{#vardefine:store property value|Uplay}}
|viveport = [https://www.viveport.com/apps/{{{link}}} Viveport][[Available from::Viveport| ]]{{#vardefine:store|Viveport}}
+
|viveport = [https://www.viveport.com/apps/{{{link}}} Viveport]{{#vardefine:store|Viveport}}{{#vardefine:store property value|Viveport}}
|retail = Retail[[Available from::Retail| ]]{{#vardefine:store|Retail}}
+
|retail = Retail{{#vardefine:store|Retail}}{{#vardefine:store property value|Retail}}
|developer = [{{{link}}} Developer website][[Available from::Developer website| ]]{{#vardefine:store|Developer}}
+
|developer = [{{{link}}} Developer website]{{#vardefine:store|Developer}}{{#vardefine:store property value|Developer website}}
|publisher = [{{{link}}} Publisher website][[Available from::Publisher website| ]]{{#vardefine:store|Publisher}}
+
|publisher = [{{{link}}} Publisher website]{{#vardefine:store|Publisher}}{{#vardefine:store property value|Publisher website}}
|official = [{{{link}}} Official website][[Available from::Official website| ]]{{#vardefine:store|Official}}
+
|official = [{{{link}}} Official website]{{#vardefine:store|Official}}{{#vardefine:store property value|Official website}}
 
|#Default  = Incorrect store name. See [[Template:Availability|here]] for available options.<includeonly>{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }}</includeonly>
 
|#Default  = Incorrect store name. See [[Template:Availability|here]] for available options.<includeonly>{{#ifeq: {{NAMESPACE}} | | [[Category:Invalid template usage (Availability)]] }}</includeonly>
}}{{#ifeq: {{NAMESPACE}} | | {{#ifeq:{{lc:{{{1}}}}} | retail | |{{#ifeq:{{{link}}} | | [[Category:Invalid template usage (Availability)]]}}}}}}
+
}}{{#if: {{#var:store property value}} | [[Available from historically::{{#var:store property value}}| ]] {{#if: {{#var:store unavailable}} | | [[Available from::{{#var:store property value}}| ]] }} }}{{#ifeq: {{NAMESPACE}} | | {{#ifeq:{{lc:{{{1}}}}} | retail | |{{#ifeq:{{{link}}} | | [[Category:Invalid template usage (Availability)]]}}}}}}{{#vardefine:store property value|}}

Latest revision as of 20:57, 4 August 2020

Incorrect store name. See here for available options.