Difference between revisions of "Template:ItemLink"

From ARK: Survival Evolved Wiki
Jump to: navigation, search
(ItemLink template to make creating image links to pages less tedious)
 
(fix SS links)
 
(88 intermediate revisions by 8 users not shown)
Line 1: Line 1:
  +
<onlyinclude><includeonly><!--
[[Image:{{{image|{{{item}}}}}}.png|{{{size|20px}}}|link={{{link|{{{item}}}}}}]] [[{{{link|{{{item}}}}}}|{{{item}}}]]
 
  +
-->{{#vardefine:dlc|}}<!--
  +
-->{{#vardefine:linktext|{{{1|}}}}}<!--
  +
-->{{#vardefine:filename|{{{image|{{#replace:{{#replace:{{#replace:{{{1}}}|:|_}}|+|-}}|/|_}}.png}}}}}<!--
  +
-->{{#if:{{{text|{{{2|}}}}}}||<!-- else
  +
-->{{#if:{{#pos:{{{1}}}|(The Center)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-13}}}}{{#vardefine:dlc|&nbsp;[[File:The Center Icon.png|link=The Center]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Primitive Plus)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-17}}}}{{#vardefine:dlc|&nbsp;[[File:Primitive Plus Icon.png|link=Primitive Plus]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Scorched Earth)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-17}}}}{{#vardefine:dlc|&nbsp;[[File:Scorched Earth Icon.png|link=Scorched Earth]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Ragnarok)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-11}}}}{{#vardefine:dlc|&nbsp;[[File:Ragnarok Icon.png|link=Ragnarok]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Valguero)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-11}}}}{{#vardefine:dlc|&nbsp;[[File:Valguero Icon.png|link=Valguero]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Aberration)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-13}}}}{{#vardefine:dlc|&nbsp;[[File:Aberration Icon.png|link=Aberration]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Extinction)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-13}}}}{{#vardefine:dlc|&nbsp;[[File:Extinction Icon.png|link=Extinction]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Genesis: Part 1)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-18}}}}{{#vardefine:dlc|&nbsp;[[File:Genesis Part 1 Icon.png|link=Genesis: Part 1]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Crystal Isles)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-16}}}}{{#vardefine:dlc|&nbsp;[[File:Crystal Isles Icon.png|link=Crystal Isles]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Genesis: Part 2)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-18}}}}{{#vardefine:dlc|&nbsp;[[File:Genesis Part 2 Icon.png|link=Genesis: Part 2]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|(Mobile)}}|{{#vardefine:linktext|{{#sub:{{{1}}}|0|-9}}}}{{#vardefine:dlc|&nbsp;[[File:Logo Mobile.svg|16x16px|link=ARK: Survival Evolved Mobile]]}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Primal Fear/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|16}}}}{{#vardefine:dlc|&nbsp;[[File:PrimalFearIcon.png|link=Mod:Primal Fear]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Ebenus Astrum/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|18}}}}{{#vardefine:dlc|&nbsp;[[File:Ebenus Astrum Icon.png|link=Mod:Ebenus Astrum]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Better MEKs!/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|17}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Better MEKs! Icon.png|link=Mod:Better MEKs!]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:ARK Additions/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|18}}}}{{#vardefine:dlc|&nbsp;[[File:ARK Additions Icon.png|link=Mod:ARK Additions]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Structures Plus/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|20}}}}{{#vardefine:dlc|&nbsp;[[File:Structures Plus Icon.png|link=Mod:Structures Plus]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Ark Eternal/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|16}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Ark Eternal Icon.png|link=Mod:Ark Eternal]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Archaic Ascension/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|22}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Archaic Ascension Icon.png|link=Mod:Archaic Ascension]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Steampunk/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|14}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Steampunk Icon.png|link=Mod:Steampunk]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Primal NPCs/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|16}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Primal NPCs Icon.png|link=Mod:Primal NPCs]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Caballus/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|13}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Caballus Icon.png|link=Mod:Caballus]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Prehistoric Beasts/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|23}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Prehistoric Beasts Icon.png|link=Mod:Prehistoric Beasts]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:The Chasm/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|14}}}}{{#vardefine:dlc|&nbsp;[[File:ChasmLogoSmall.jpg|link=Mod:The Chasm]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Castles, Keeps, and Forts Remastered/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|41}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Castles Keeps Forts Architecture Remastered Icon.png|link=Mod:Castles, Keeps, and Forts Remastered]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Crystal Isles Dino Collection/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|34}}}}{{#vardefine:dlc|&nbsp;[[File:Crystal Isles Dino Collection Icon.png|link=Mod:Crystal Isles Dino Collection]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Additional Creatures: Grand Hunt/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|37}}}}{{#vardefine:dlc|&nbsp;[[File:Additional Creatures Grand Hunt Icon.png|link=Mod:Additional Creatures: Grand Hunt]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->{{#if:{{#pos:{{{1}}}|Mod:Super Structures/}}|{{#vardefine:linktext|{{#sub:{{{1}}}|21}}}}{{#vardefine:dlc|&nbsp;[[File:Mod Super Structures icon.png|link=Mod:Super Structures]]}}{{#vardefine:filename|{{#replace:{{#var:filename}}|:|_}}}}}}<!--
  +
-->}}<!--
  +
-->{{#if:{{{quantity|}}}| {{{quantity}}}&nbsp;×&nbsp; }}<!--
  +
-->[[File:{{#var:filename}}|{{{size|20x20px}}}|class=itemlink|alt=|link={{{link|{{{1}}}}}}]] [[{{{link|{{{1}}}}}} | {{{text|{{{2|{{PAGENAME:{{#var:linktext}}}}}}}}}}]]<!--
  +
-->{{#if:{{{noDlcIcon|}}}||{{#var:dlc|}}}}<!--
  +
--></includeonly></onlyinclude>
  +
{{doc}}
  +
[[Category:Formatting templates]]
  +
[[fr:Modèle:ItemLink]]
  +
[[it:Template:ItemLink]]
  +
[[pl:Szablon:Przedmiot]]

Latest revision as of 16:21, 26 August 2020

Template-info.png Documentation

Link to an item page with an item image in front: Stone

Also supports an optional quantity in front: 5 ×  Stone

Usage

{{ItemLink|Stone}}
Parameters
Name Type Required Default
0 string true
text string false The value of the first positional parameter, or the second if given
link string false The value of the first positional parameter
image string false The value of the first positional parameter suffixed with .png
size string false 20px
quantity string false
noDlcIcon bool false

Examples

Both lines produce the same output:

{{ItemLink|Stone}} = Stone

{{ItemLink|Stone|text=Stone|link=Stone|image=Stone.png|size=20px|quantity=}} = Stone

Lowercase link:

{{ItemLink|Stone|text=stone}} = stone
{{ItemLink|Stone|stone}} = stone

Plural link:

{{ItemLink|Stone|text=Stones}} = Stones
Alternative: {{ItemLink|Stone}}s = Stones

Quantity:

{{ItemLink|Stone|quantity=5}} = 5 ×  Stone
{{ItemLink|Stone|quantity=5-10}} = 5-10 ×  Stone

DLC-suffices are converted automatically to the according icon, if no explicit link-text is given

{{ItemLink|Sand (Scorched Earth)}} = Sand Scorched Earth Icon.png
{{ItemLink|Sand (Scorched Earth)|Sand}} = Sand

Mods that are supported will have the mod-part replaced with their icon

{{ItemLink|Mod:Ark Eternal/Alpha Meat}} = Alpha Meat Mod Ark Eternal Icon.png

The parameter noDlcIcon hides the extra DLC-/mod-icon

{{ItemLink|Sand (Scorched Earth)|noDlcIcon=1}} = Sand