ARK: Survival Evolved Wiki
(Undo revision 24236 by IllegalOpcode (talk) because apparently MediaWiki is smarter than I thought)
(added example for mod-item)
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{doc/start}}
 
{{doc/start}}
Link to an item page with an item image in front: {{ItemLink|item=Stone}}
+
Link to an item page with an item image in front: {{ItemLink|Stone}}
   
  +
Also supports an optional quantity in front: {{ItemLink|Stone|quantity=5}}
== Usage ==
 
<nowiki>{{ItemLink|item=Stone}}</nowiki>
 
   
 
== Usage ==
<nowiki>{{ItemLink|item=Stone|text=Stone|link=Stone|image=Stone|size=20px}}</nowiki>
 
 
<nowiki>{{ItemLink|Stone}}</nowiki>
   
 
{| class="wikitable"
 
{| class="wikitable"
Line 12: Line 12:
 
! Name !! Type !! Required !! Default
 
! Name !! Type !! Required !! Default
 
|-
 
|-
|| <code>item</code>
+
|| <code>0</code>
 
|| <code>string</code>
 
|| <code>string</code>
 
|| <code>true</code>
 
|| <code>true</code>
  +
||
|| ''None''
 
 
|-
 
|-
 
|| <code>text</code>
 
|| <code>text</code>
 
|| <code>string</code>
 
|| <code>string</code>
 
|| <code>false</code>
 
|| <code>false</code>
|| The value of the <code>item</code> parameter
+
|| The value of the first positional parameter, or the second if given
 
|-
 
|-
 
|| <code>link</code>
 
|| <code>link</code>
 
|| <code>string</code>
 
|| <code>string</code>
 
|| <code>false</code>
 
|| <code>false</code>
|| The value of the <code>item</code> parameter
+
|| The value of the first positional parameter
 
|-
 
|-
 
|| <code>image</code>
 
|| <code>image</code>
 
|| <code>string</code>
 
|| <code>string</code>
 
|| <code>false</code>
 
|| <code>false</code>
|| The value of the <code>item</code> parameter suffixed with <code>.png</code>
+
|| The value of the first positional parameter suffixed with <code>.png</code>
 
|-
 
|-
 
|| <code>size</code>
 
|| <code>size</code>
|| <code>integer</code>
+
|| <code>string</code>
 
|| <code>false</code>
 
|| <code>false</code>
 
|| 20px
 
|| 20px
  +
|-
  +
|| <code>quantity</code>
  +
|| <code>string</code>
  +
|| <code>false</code>
  +
||
  +
|-
  +
|| <code>noDlcIcon</code>
  +
|| <code>bool</code>
  +
|| <code>false</code>
  +
||
 
|}
 
|}
   
Line 41: Line 51:
 
Both lines produce the same output:
 
Both lines produce the same output:
   
<code><nowiki>{{ItemLink|item=Stone}}</nowiki></code> = {{ItemLink|item=Stone}}
+
<code><nowiki>{{ItemLink|Stone}}</nowiki></code> = {{ItemLink|Stone}}
   
<code><nowiki>{{ItemLink|item=Stone|text=Stone|link=Stone|image=Stone|size=20px}}</nowiki></code> = {{ItemLink|item=Stone|text=Stone|link=Stone|image=Stone|size=20px}}
+
<code><nowiki>{{ItemLink|Stone|text=Stone|link=Stone|image=Stone.png|size=20px|quantity=}}</nowiki></code> = {{ItemLink|Stone|text=Stone|link=Stone|image=Stone.png|size=20px|quantity=}}
   
 
Lowercase link:
 
Lowercase link:
   
<code><nowiki>{{ItemLink|item=Stone|text=stone}}</nowiki></code> = {{ItemLink|item=Stone|text=stone}}
+
<code><nowiki>{{ItemLink|Stone|text=stone}}</nowiki></code> = {{ItemLink|Stone|text=stone}}<br>
  +
<code><nowiki>{{ItemLink|Stone|stone}}</nowiki></code> = {{ItemLink|Stone|stone}}
   
 
Plural link:
 
Plural link:
   
<code><nowiki>{{ItemLink|item=Stone|text=Stones}}</nowiki></code> = {{ItemLink|item=Stone|text=Stones}}
+
<code><nowiki>{{ItemLink|Stone|text=Stones}}</nowiki></code> = {{ItemLink|Stone|text=Stones}}<br>
  +
Alternative: <code><nowiki>{{ItemLink|Stone}}s</nowiki></code> = {{ItemLink|Stone}}s
  +
  +
Quantity:
  +
  +
<code><nowiki>{{ItemLink|Stone|quantity=5}}</nowiki></code> = {{ItemLink|Stone|quantity=5}}<br>
  +
<code><nowiki>{{ItemLink|Stone|quantity=5-10}}</nowiki></code> = {{ItemLink|Stone|quantity=5-10}}
  +
  +
DLC-suffices are converted automatically to the according icon, if no explicit link-text is given
  +
  +
<code><nowiki>{{ItemLink|Sand (Scorched Earth)}}</nowiki></code> = {{ItemLink|Sand (Scorched Earth)}}<br>
  +
<code><nowiki>{{ItemLink|Sand (Scorched Earth)|Sand}}</nowiki></code> = {{ItemLink|Sand (Scorched Earth)|Sand}}
  +
  +
Mods that are supported will have the mod-part replaced with their icon
  +
  +
<code><nowiki>{{ItemLink|Mod:Ark Eternal/Alpha Meat}}</nowiki></code> = {{ItemLink|Mod:Ark Eternal/Alpha Meat}}
  +
  +
The parameter noDlcIcon hides the extra DLC-/mod-icon
  +
  +
<code><nowiki>{{ItemLink|Sand (Scorched Earth)|noDlcIcon=1}}</nowiki></code> = {{ItemLink|Sand (Scorched Earth)|noDlcIcon=1}}<br>
  +
 
{{doc/end}}
 
{{doc/end}}
   
Line 60: Line 91:
 
"description": "Link to an item page with an item image in front",
 
"description": "Link to an item page with an item image in front",
 
"params": {
 
"params": {
"item": {
+
"0": {
 
"label": "Item name",
 
"label": "Item name",
 
"description": "The item.",
 
"description": "The item.",
Line 84: Line 115:
 
"label": "Size",
 
"label": "Size",
 
"description": "The image size. Defaults to 20px.",
 
"description": "The image size. Defaults to 20px.",
  +
"type": "string"
  +
},
  +
"quantity": {
  +
"label": "Quantity",
  +
"description": "The quantity to display to the left of the image.",
 
"type": "number"
 
"type": "number"
 
}
 
}
Line 90: Line 126:
 
</templatedata>
 
</templatedata>
 
-->
 
-->
  +
[[it:Template:ItemLink/doc]]

Revision as of 22:46, 3 January 2020

Template-info Documentation

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

Also supports an optional quantity in front: 5 × Stone 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 Stone

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

Lowercase link:

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

Plural link:

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

Quantity:

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

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

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

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

{{ItemLink|Mod:Ark Eternal/Alpha Meat}} = Mod Ark Eternal Alpha Meat Alpha Meat (Mod:Ark Eternal)

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

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