Template:ItemLink/doc: Difference between revisions
Streetclaw (talk | contribs) |
m (Use the `partial` parameter of Template:TemplateData) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{doc/start}} | {{doc/start}} | ||
{{Lua|Module:ItemLink|Module:ItemLink/nameList|Module:ItemLink/levelList|Module:ItemLink/foodIconList}} | |||
This is a template for adding links to items. | This is a template for adding links to items. | ||
Line 14: | Line 16: | ||
* {{ItemLink|Edge o' All}}</pre>|type=String|status=Required}} | * {{ItemLink|Edge o' All}}</pre>|type=String|status=Required}} | ||
{{TemplateData/entry|name=Name Override|param=showName|desc=Shows the defined name/Overrides the Item-Name (alternative Name)|def=NULL|example={{ItemLink|Ginger Tom. Salad|showName=Blattsalat}} <pre>{{ItemLink|Ginger Tom. Salad|showName=Blattsalat}}</pre>|type=String|status=Optional}} | {{TemplateData/entry|name=Name Override|param=showName|desc=Shows the defined name/Overrides the Item-Name (alternative Name)|def=NULL|example={{ItemLink|Ginger Tom. Salad|showName=Blattsalat}} <pre>{{ItemLink|Ginger Tom. Salad|showName=Blattsalat}}</pre>|type=String|status=Optional}} | ||
| partial = 1 | |||
}} | }} | ||
Line 46: | Line 49: | ||
* Hide (<code>0</code>): {{ItemLink|Chili Dog|showFoodIcon=0}} | * Hide (<code>0</code>): {{ItemLink|Chili Dog|showFoodIcon=0}} | ||
* Default (parameter not used / <code>0</code>): {{ItemLink|Chili Dog}}</pre>|type=Boolean|status=Optional}} | * Default (parameter not used / <code>0</code>): {{ItemLink|Chili Dog}}</pre>|type=Boolean|status=Optional}} | ||
| partial = 1 | |||
}} | }} | ||
Line 51: | Line 55: | ||
{{TemplateData| | {{TemplateData| | ||
{{TemplateData/entry|name=Disable brakes|param=nowrap|desc=disable or enable Nowrap (prevent line breaks)|def=1|example=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. {{ItemLink|Scrappy Plate|nowrap=0}} Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. {{ItemLink|Scrappy Plate|nowrap=0}} Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</pre>|type=Boolean|status=Optional}} | {{TemplateData/entry|name=Disable brakes|param=nowrap|desc=disable or enable Nowrap (prevent line breaks)|def=1|example=Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. {{ItemLink|Scrappy Plate|nowrap=0}} Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. <pre>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. {{ItemLink|Scrappy Plate|nowrap=0}} Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</pre>|type=Boolean|status=Optional}} | ||
| partial = 1 | |||
}} | }} | ||
Line 57: | Line 62: | ||
{{TemplateData| | {{TemplateData| | ||
{{TemplateData/entry|name=Level override|param=level|desc=Set a custom level to display. | {{TemplateData/entry | ||
| name = Level override | |||
| param = level | |||
| desc = Set a custom level to display. | |||
| example = <nowiki/> | |||
; Equipment<nowiki>:</nowiki> | |||
: {{ItemLink|Edge o' All|level=2}} | |||
: {{ItemLink|Scrappy Plate|level=17}} | |||
: {{ItemLink|Old Geta|level=ascended}} | |||
; Other Item(s)<nowiki>:</nowiki> | |||
: {{ItemLink|Chili Dog|level=15}} | |||
<pre> | |||
; Equipment: | |||
: {{ItemLink|Edge o' All|level=2}} | |||
: {{ItemLink|Scrappy Plate|level=17}} | |||
: {{ItemLink|Old Geta|level=ascended}} | |||
; Other Item(s): | |||
: {{ItemLink|Chili Dog|level=15}} | |||
</pre> | |||
| type = <nowiki>[ Number | "ascended" ]</nowiki> | |||
| status = Optional | |||
}} | |||
| partial = 1 | |||
}} | }} | ||
Line 65: | Line 92: | ||
{{TemplateData| | {{TemplateData| | ||
{{TemplateData/entry|name=Food icon override|param=foodIcon|desc=Set a custom food icon|def=NULL|example=Food: {{ItemLink|Chili Dog|foodIcon=FruitSalad_FoodIcon.png}} Other Item(s): {{ItemLink|Scrappy Plate|foodIcon=FruitSalad_FoodIcon.png}}<pre>Food: {{ItemLink|Chili Dog|foodIcon=FruitSalad_FoodIcon.png}} Other Item(s): {{ItemLink|Scrappy Plate|foodIcon=FruitSalad_FoodIcon.png}}</pre>|type=String|status=Optional}} | {{TemplateData/entry|name=Food icon override|param=foodIcon|desc=Set a custom food icon|def=NULL|example=Food: {{ItemLink|Chili Dog|foodIcon=FruitSalad_FoodIcon.png}} Other Item(s): {{ItemLink|Scrappy Plate|foodIcon=FruitSalad_FoodIcon.png}}<pre>Food: {{ItemLink|Chili Dog|foodIcon=FruitSalad_FoodIcon.png}} Other Item(s): {{ItemLink|Scrappy Plate|foodIcon=FruitSalad_FoodIcon.png}}</pre>|type=String|status=Optional}} | ||
| partial = 1 | |||
}} | }} | ||
Line 70: | Line 98: | ||
{{TemplateData| | {{TemplateData| | ||
{{TemplateData/entry|name=No Rename|param=noRename|desc=disable or enable noRename (prevent auto-rename)|def=0|example=noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|-Rauser|showName=-Rauser<sub>r</sub>}} <pre>noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|Rauser|noRename=0}}</pre>|type=Boolean|status=Optional}} | {{TemplateData/entry|name=No Rename|param=noRename|desc=disable or enable noRename (prevent auto-rename)|def=0|example=noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|-Rauser|showName=-Rauser<sub>r</sub>}} <pre>noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|Rauser|noRename=0}}</pre>|type=Boolean|status=Optional}} | ||
| partial = 1 | |||
}} | }} | ||
=== Return information (internal use) === | === Return information (internal use) === | ||
{{TemplateData| | {{TemplateData| | ||
{{TemplateData/entry | {{TemplateData/entry | ||
|name=Level return (Data override) | |||
|param=levelOverride | |||
|desc=disable or enable levelOverride (return the level) | |||
|def=0 | |||
|example= | |||
* levelOverride: {{ItemLink|Scrappy Plate|levelOverride=1}} | * levelOverride: {{ItemLink|Scrappy Plate|levelOverride=1}} | ||
<pre>levelOverride: {{ItemLink|Scrappy Plate|levelOverride=1}}</pre> | <pre>levelOverride: {{ItemLink|Scrappy Plate|levelOverride=1}}</pre> | ||
Line 82: | Line 114: | ||
<pre>no levelOverride: {{ItemLink|Scrappy Plate|levelOverride=0}}</pre> | <pre>no levelOverride: {{ItemLink|Scrappy Plate|levelOverride=0}}</pre> | ||
* Other Item(s): {{ItemLink|Chili Dog|levelOverride=1}}(blank) | * Other Item(s): {{ItemLink|Chili Dog|levelOverride=1}}(blank) | ||
<pre>Other Item(s): {{ItemLink|Chili Dog|levelOverride=1}}(blank)</pre>|type=Boolean|status=Optional}}(blank) | <pre>Other Item(s): {{ItemLink|Chili Dog|levelOverride=1}}(blank)</pre> | ||
|type=Boolean | |||
|status=Optional | |||
}} | |||
{{TemplateData/entry | |||
|name=Level return (allow ascended) | |||
|param=allowAscended | |||
|desc=Allow returning <code>ascended</code> when <code>levelOverride</code> is <code>1</code>.<br | |||
/>Lua modules should use <code>[[mw:Extension:Scribunto/Lua_reference_manual#mw.loadData|mw.loadData]]("[[Module:ItemLink/levelList]]")</code> directly. | |||
|def=0 | |||
|example= | |||
* <pre>allowAscended: {{ItemLink|Lifefiber Dress|levelOverride=1|allowAscended=1}}</pre><!-- | |||
-->allowAscended: {{ItemLink|Lifefiber Dress|levelOverride=1|allowAscended=1}} | |||
* <pre>no allowAscended: {{ItemLink|Lifefiber Dress|levelOverride=1|allowAscended=0}} (blank)</pre><!-- | |||
-->no allowAscended: {{ItemLink|Lifefiber Dress|levelOverride=1|allowAscended=0}} (blank) | |||
|type=Boolean | |||
|status=Optional | |||
}} | |||
| partial = 1 | |||
}} | }} | ||
Line 143: | Line 194: | ||
! Description | ! Description | ||
|- | |- | ||
| [[ | | [[Module:ItemLink/nameList]] | ||
| Contains all Items which should be Renamed | | Contains all Items which should be Renamed | ||
|- | |- | ||
| [[ | | [[Module:ItemLink/levelList]] | ||
| Contains all Level data | | Contains all Level data | ||
|- | |- | ||
| [[ | | [[Module:ItemLink/foodIconList]] | ||
| Contains all Food icons | | Contains all Food icons | ||
|} | |} | ||
Line 211: | Line 256: | ||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
{{TemplateData}} | |||
{{doc/end}} | {{doc/end}} | ||
<includeonly> | |||
[[Category:Link templates]] | |||
</includeonly> |
Latest revision as of 23:16, 9 May 2021
File:Lua logo.svg | This template uses Lua: |
This is a template for adding links to items.
About
Add a link to the Item. There are many possibitities to customize the behavior.
Parameter
Item name
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item Name | 1
|
Item name
|
String | Required |
Name Override | showName
|
Shows the defined name/Overrides the Item-Name (alternative Name)
|
String | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Hide and show elements
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
No Icon | noIcon
|
Hides the Icon
|
Boolean | Optional |
No Link | noLink
|
Removes the link |
Boolean | Optional |
No level | noLevel
|
Hides the level
|
Boolean | Optional |
Show Food Icon | showFoodIcon
|
Show the food icon
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Wrap behavior
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Disable brakes | nowrap
|
disable or enable Nowrap (prevent line breaks)
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Custom Level
The associated equipment level is shown by default. Use the option only for an deviating equipment level or for adding a level to non equipment items.
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Level override | level
|
Set a custom level to display.
|
[ Number | "ascended" ] | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Custom Food icon
The food icon is hidden by default see Hide and show elements for showing the associated food icon.
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Food icon override | foodIcon
|
Set a custom food icon
|
String | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Disable auto-rename
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
No Rename | noRename
|
disable or enable noRename (prevent auto-rename) |
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Return information (internal use)
Do not use named parameter for 1
... x
. The first Parameter will be automatically marked as 1
, the second as 2
and so on.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Level return (Data override) | levelOverride
|
disable or enable levelOverride (return the level)
|
Boolean | Optional |
Level return (allow ascended) | allowAscended
|
Allow returning
|
Boolean | Optional |
See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation
Special Items
Code | Result |
---|---|
{{ItemLink|Health Pickup}} |
![]() |
Invalid Item
If an item is misspelled, does not exist or simply has not been added to the template will show a broken icon.
Name
Names containing special characters (#
) are not supported. Remove them and use showName
for this characters.
It is possible that the name appears different than that entered one:
{{ItemLink|Rauser}}Rauser will be displayed as LV01

* {{ItemLink|Rauser}} * {{ItemLink|-Rauser}} * {{ItemLink|Rauser|showName=No Rauser}} * {{ItemLink|Rauser|noRename=1}}
Wikimedia supports linktrail which allows to add specific characters to an link:
[[Hedgehag]]s
{{ItemLink|Veggie Set}}sresults in

Under specific conditions (parameter nowrap=0 is needed) Linktrail is supported by ItemLink:
{{ItemLink|Veggie Set|nowrap=0}}s
If nowrap is necessary:
{{Nowrap|{{ItemLink|Veggie Set|nowrap=0}}s}}
Linktrail and renamed Items:
{{ItemLink|Rauser|nowrap=0}}s
LV01-Rauserrs
Item Lists
List | Description |
---|---|
Module:ItemLink/nameList | Contains all Items which should be Renamed |
Module:ItemLink/levelList | Contains all Level data |
Module:ItemLink/foodIconList | Contains all Food icons |
Rules for the Item Lists
- All Items should be sorted by Id (That ist the position of the Entry inside the item-database.json. Alternative: ItemViewer on Github) - Path to item-database.json:
- Mac OS
- Open the .app package (Context Menu - show package)
- Navigate to Contents/Resources/app.nw/data/item-database.json
- Windows
- Create a copy of your Game (.exe)
- Rename .exe to .zip
- Unpack the zip file
- Navigate to Contents/Resources/app.nw/data/item-database.json
- Mac OS
- Only subsections should be editied
- Achor Nameing rules:
- Whitspace = _
- English Item-names only
- Only use the special characters _ and -
- Remove all other special Chars like ' . , # ; < > ( ) { } / \
- Remove all - if they are at first position: -Item -> Item
- Don't be shy. If there is a missing Item, add it.
Examples
Code | Result |
---|---|
{{ItemLink|Winterclaw}} |
LV26![]() |
{{ItemLink|Geo-Data 3469|showName=Geo-Data #3469}} |
![]() |
{{ItemLink|Recruit's Scope}} |
LV11![]() |
{{ItemLink|Ginger Tom. Salad|showName=Blattsalat|noLink=1}} |
![]() |
Raw Example text
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Thief's Key Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
No description.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Item Name | 1 | Item name
| String | required |
Name Override | showName | Shows the defined name/Overrides the Item-Name (alternative Name)
| String | optional |
No Icon | noIcon | Hides the Icon
| Boolean | optional |
No Link | noLink | Removes the link
| Boolean | optional |
No level | noLevel | Hides the level
| Boolean | optional |
Show Food Icon | showFoodIcon | Show the food icon
| Boolean | optional |
Disable brakes | nowrap | disable or enable Nowrap (prevent line breaks)
| Boolean | optional |
Level override | level | Set a custom level to display.
| Content | optional |
Food icon override | foodIcon | Set a custom food icon
| String | optional |
No Rename | noRename | disable or enable noRename (prevent auto-rename)
| Boolean | optional |
Level return (Data override) | levelOverride | disable or enable levelOverride (return the level)
| Boolean | optional |
Level return (allow ascended) | allowAscended | Allow returning <code>ascended</code> when <code>levelOverride</code> is <code>1</code>.<br />Lua modules should use <code>[[mw:Extension:Scribunto/Lua_reference_manual#mw.loadData|mw.loadData]]("[[Module:ItemLink/levelList]]")</code> directly.
| Boolean | optional |