Template:ItemLink/doc: Difference between revisions

From CrossCode Wiki
Jump to navigation Jump to search
(New definition)
Line 7: Line 7:
== Parameter ==
== Parameter ==
{{TemplateData|
{{TemplateData|
{{TemplateData/entry|name=Item Name|param=1|desc=Item name|def=NULL|example={{ItemLink|Ginger Tom. Salad}} <pre>{{ItemLink|Ginger Tom. Salad}}</pre>|type=String|status=Required}}
{{TemplateData/entry|name=No Icon|param=noIcon|desc=Hides the Icon|def=0|example={{ItemLink|Ginger Tom. Salad|noIcon=1}} <pre>{{ItemLink|Ginger Tom. Salad|noIcon=1}}</pre>|type=Boolean|status=Optional}}
{{TemplateData/entry|name=No Icon|param=noIcon|desc=Hides the Icon|def=0|example={{ItemLink|Ginger Tom. Salad|noIcon=1}} <pre>{{ItemLink|Ginger Tom. Salad|noIcon=1}}</pre>|type=Boolean|status=Optional}}
{{TemplateData/entry|name=Show Name|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=Show Name|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}}

Revision as of 20:11, 29 December 2016

File:Template-info.svg Template Documentation

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

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

Default:
NULL
Example:
Ginger Tom. Salad
{{ItemLink|Ginger Tom. Salad}}
String Required
No Icon noIcon

Hides the Icon

Default:
0
Example:
Ginger Tom. Salad
{{ItemLink|Ginger Tom. Salad|noIcon=1}}
Boolean Optional
Show Name showName

Shows the defined name/Overrides the Item-Name (alternative Name)

Default:
NULL
Example:
Blattsalat
{{ItemLink|Ginger Tom. Salad|showName=Blattsalat}}
String Optional
No Link noLink

Removes the link

Default:
0
Example:
Chili Dog
{{ItemLink|Chili Dog|noLink=1}}
Boolean Optional
Anchor Override anchorOverride

Internal use only (return the anchor-name) - overrides all other parameter except linkOverride and nowrap

Default:
0
Example:
Geo-Data #3469
{{ItemLink|Geo-Data #3469|anchorOverride=1}}
Boolean Optional
Link Override linkOverride

Internal use only (return the link) - overrides all other parameter and anchorOverride

Default:
0
Example:
Geo-Data #3469
{{ItemLink|Geo-Data #3469|linkOverride=1}}
Boolean Optional
Disable brakes nowrap

disable or enable Nowrap (prevent line breaks)

Default:
1
Example:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. LV11Scrappy Plate Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
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.
Boolean Optional
No Rename noRename

disable or enable noRename (prevent auto-rename)

Default:
0
Example:
noRename: LV01Rauser Rename: LV01-Rauserr
noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|Rauser|noRename=0}}
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

Test of raw TemplateData output:

No description.

Template parameters

ParameterDescriptionTypeStatus
Item Name1

Item name

Example
<span class="nowrap" style="white-space:nowrap"><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Ginger Tom. Salad.png|24x24px]]</span>[[Ginger Tom. Salad|Ginger Tom. Salad]]</span>
{{ItemLink|Ginger Tom. Salad}}
Stringrequired
No IconnoIcon

Hides the Icon

Default
0
Example
<span class="nowrap" style="white-space:nowrap">[[Ginger Tom. Salad|Ginger Tom. Salad]]</span>
{{ItemLink|Ginger Tom. Salad|noIcon=1}}
Booleanoptional
Show NameshowName

Shows the defined name/Overrides the Item-Name (alternative Name)

Example
<span class="nowrap" style="white-space:nowrap"><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Ginger Tom. Salad.png|24x24px]]</span>[[Ginger Tom. Salad|Blattsalat]]</span>
{{ItemLink|Ginger Tom. Salad|showName=Blattsalat}}
Stringoptional
No LinknoLink

Removes the link

Default
0
Example
<span class="nowrap" style="white-space:nowrap"><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Chili Dog.png|24x24px]]</span>Chili Dog</span>
{{ItemLink|Chili Dog|noLink=1}}
Booleanoptional
Anchor OverrideanchorOverride

Internal use only (return the anchor-name) - overrides all other parameter except linkOverride and nowrap

Default
0
Example
<span class="nowrap" style="white-space:nowrap"><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Geo-Data 3469.png|24x24px]]</span>[[Geo-Data 3469|Geo-Data #3469]]</span>
{{ItemLink|Geo-Data #3469|anchorOverride=1}}
Booleanoptional
Link OverridelinkOverride

Internal use only (return the link) - overrides all other parameter and anchorOverride

Default
0
Example
<span class="nowrap" style="white-space:nowrap"><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Geo-Data 3469.png|24x24px]]</span>[[Geo-Data 3469|Geo-Data #3469]]</span>
{{ItemLink|Geo-Data #3469|linkOverride=1}}
Booleanoptional
Disable brakesnowrap

disable or enable Nowrap (prevent line breaks)

Default
1
Example
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <span class="itemLinkLevel">LV<sub>11</sub></span><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Scrappy Plate.png|24x24px]]</span>[[Scrappy Plate|Scrappy Plate]] Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
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.
Booleanoptional
No RenamenoRename

disable or enable noRename (prevent auto-rename)

Default
0
Example
noRename: <span class="nowrap" style="white-space:nowrap"><span class="itemLinkLevel">LV<sub>01</sub></span><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Rauser.png|24x24px]]</span>[[Rauser|Rauser]]</span> Rename: <span class="nowrap" style="white-space:nowrap"><span class="itemLinkLevel">LV<sub>01</sub></span><span class="itemLinkIcon" style="image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;">[[File:Rauser.png|24x24px]]</span>[[Category:AutoRenamedItem]][[Rauser|-Rauser<sub>r</sub>]]</span>
noRename: {{ItemLink|Rauser|noRename=1}} Rename: {{ItemLink|Rauser|noRename=0}}
Booleanoptional

Special Items

Code Result
{{ItemLink|Health Pickup}}
Health Pickup

Default Item

If an item is misspelled, does not exist or simply has not been added to the template yet, it will show the default item image and link to the Items page (File:Foo.pngfoo).

Name

Names containing special characters are supported.

It is possible that the name appears different than that entered one:

{{ItemLink|Raw Steak}}
Raw Steak will be displayed as Raw Steak. In these cases they are marked with an r (for renamed). All renamed Items will be listet in the category AutoRenamedItem.
* {{ItemLink|Rauser}}
* {{ItemLink|-Rauser}}
* {{ItemLink|Rauser NOEZ}}
* {{ItemLink|-Rauser NOEZ}}
* {{ItemLink|Rauser|showName=No Rauser}}
* {{ItemLink|Rauser|noRename=1}}

Wikimedia supports linktrail which allows to add specific charaters to an link:

[[Hedgehag]]s

Hedgehags

Under specific conditions (parameter nowrap=0 is needed) Linktrail is supported by ItemLink:

{{ItemLink|Veggie Set|nowrap=0}}s

Veggie Sets

If nowrap is nessesary:

{{Nowrap|{{ItemLink|Veggie Set|nowrap=0}}s}}

Veggie Sets

Linktrail and renamed Items:

{{ItemLink|Rauser|nowrap=0}}s

LV01-Rauserrs

Item Lists

List Description
Template:ItemLink/iconList Contains all Icons
Template:ItemLink/nameList Contains all Items which should be Renamed
Template:ItemLink/anchorList Contains all Items which anchor should be Renamed
Template:ItemLink/linkList Contains all Links to the Item Pages

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
      1. Open the .app package (Context Menu - show package)
      2. Navigate to Contents/Resources/app.nw/data/item-database.json
    • Windows
      1. Create a copy of your Game (.exe)
      2. Rename .exe to .zip
      3. Unpack the zip file
      4. Navigate to Contents/Resources/app.nw/data/item-database.json
  • Only subsections should be editied
  • Achor Nameing rules:
    • Whitspace = _
    • English Item-names only
    • Only user the special Charaters _ 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}}
LV26Winterclaw
{{ItemLink|Geo-Data #3469}}
Geo-Data #3469
{{ItemLink|Recruit's Scope}}
LV11Recruit's Scope
{{ItemLink|Ginger Tom. Salad|showName=Blattsalat|noLink=1}}
Blattsalat