Main Page

Difference between revisions of "Template:NGSItem"

From Arks-Visiphone
Jump to navigation Jump to search
(correct names)
(Add additional documentation)
Line 1: Line 1:
<onlyinclude><span style="white-space: nowrap">{{ #if: {{{Icon|}}} | {{Icons|{{{Icon}}}}} }} [[{{{1}}}{{ #if: {{{2|}}}|{{!}}{{{2}}}}}]]</span></onlyinclude>
+
<onlyinclude><span style="white-space: nowrap">{{ #if: {{{Icon|}}} | {{Icons|{{{Icon}}}}} }} {{ #if: {{{PageName|}}} |then [[{{{PageName}}}{{ #if: {{{RealName|}}}|{{!}}{{{RealName}}}}}]] | {{{RealName}}} |}}</span></onlyinclude>
 
 
 
<noinclude>
 
<noinclude>
==Documentation==
+
{{Documentation|content=
This is intended to be used on NGS pages to list the names of items, while showing a UI icon and preventing a line break mid-name.
+
This template is intended to be used on NGS pages to list the names of items, while showing a UI icon and preventing a line break mid-name.
  
{{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
+
== Example ==
 
+
Writing the following:
{{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
+
<pre>{{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}</pre>
 +
Results in this:
  
{| class="wikitable" style="width: 30%;"
+
{{NGSItem|Icon=NGS Sword|PageName=Swords_(NGS)|RealName=Prim Sword}}
| colspan="2" | This column width is 30% of the screen width
 
|-
 
| style="width: 10%"| {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
 
| style="width: 20%"| {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
 
|}
 
  
 +
but if you don't include a PageName, it won't be linked:
  
<pre>{{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}</pre>
+
{{NGSItem|Icon=NGS Sword|RealName=Prim Sword}}
 +
}}
 +
<templatedata>
 +
{
 +
    "description": "Use this template on NGS pages to display an item name that does not line-break. Optionally, a UI icon can be included.",
 +
    "format": "inline",
 +
    "params": {
 +
        "Icon": {
 +
            "label": "UI Icon",
 +
            "description": "The small icon that is used in-game. This appears to the left of the item name.",
 +
            "type": "string"
 +
            "example": "NGS Sword",
 +
            "suggested": true
 +
        },
 +
        "PageName": {
 +
            "label": "Page Name",
 +
            "description": "This is the page that clicking the name of the item will link to. If not specified, then the item link on the page will not have a link.",
 +
            "type": "string"
 +
            "example": "Swords_(NGS)",
 +
            "suggested": true
 +
        },
 +
        "RealName": {
 +
            "label": "Real Name",
 +
            "description": "This is the name of the item visible in-game. This is required.",
 +
            "type": "string"
 +
            "example": "Prinm Sword",
 +
            "required": true
 +
        }
 +
    }
 +
}
 +
</templatedata>
 
</noinclude>
 
</noinclude>

Revision as of 11:51, 28 November 2021

{{{RealName}}}

Template documentation

This template is intended to be used on NGS pages to list the names of items, while showing a UI icon and preventing a line break mid-name.

Example

Writing the following:

{{NGSItem|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}

Results in this:

Sword (NGS) then Prim Sword

but if you don't include a PageName, it won't be linked:

Sword (NGS) Prim Sword

Syntax error in JSON.