Main Page

Difference between revisions of "Template:NGSItem"

From Arks-Visiphone
Jump to navigation Jump to search
m (Sonickyle27 moved page User:Sonickyle27/Template:NGS Item to Template:NGSItem: Move to main space)
(Was going to add suggested values, but it don't works. Include what I was going to add into a block for now.)
 
(11 intermediate revisions by the same user not shown)
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|}}} | [[{{{PageName}}}{{ #if: {{{RealName|}}}|{{!}}{{{RealName}}}}}]] | {{{RealName}}}}}{{ #if: {{{Amount|}}}| &nbsp;×{{{Amount}}}}}</span></onlyinclude>
 +
<noinclude>
 +
{{Documentation|content=
 +
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.
  
<noinclude>
+
== Example ==
==Documentation==
+
Writing the following:
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.
+
<pre>{{NGSItem|Icon=NGS Sword|PageName=Swords_(NGS)|RealName=Prim Sword}}</pre>
 +
results in this:
 +
 
 +
{{NGSItem|Icon=NGS Sword|PageName=Swords_(NGS)|RealName=Prim Sword}}.
 +
 
 +
but if you don't include a PageName, it won't be linked:
 +
 
 +
{{NGSItem|Icon=NGS Sword|RealName=Prim Sword}}.
  
{{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
+
You can also specify the amount of the item, which is great for items like Materials that you get multiple of for example, like N-Grinders.
  
{{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
+
<pre>{{NGSItem|Icon=NGS Tool|RealName=N-Grinder|Amount=50}}</pre>
 +
Results in this:
  
{| class="wikitable" style="width: 30%;"
+
{{NGSItem|Icon=NGS Tool|RealName=N-Grinder|Amount=50}}.
| colspan="2" | This column width is 30% of the screen width
 
|-
 
| style="width: 10%"| {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
 
| style="width: 20%"| {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}, {{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}
 
|}
 
  
 +
}}
  
<pre>{{User:Sonickyle27/Template:NGS_Item|Icon=NGS Sword|Swords_(NGS)|Prim Sword}}</pre>
+
== TODO==
 +
When suggested values are implement, add the following to the UI Icon entry:
 +
<nowiki>,
 +
"suggestedvalues": [
 +
"NGS Sword",
 +
"NGS Partizan",
 +
"NGS Wired Lances",
 +
"NGS Double Saber",
 +
"NGS Knuckles",
 +
"NGS Twin Daggers",
 +
"NGS Gunslash",
 +
"NGS Dual Blades",
 +
"NGS Assault Rifle",
 +
"NGS Twin Machine Guns",
 +
"NGS Bullet Bow",
 +
"NGS Rod",
 +
"NGS Wand",
 +
"NGS Talis",
 +
"NGS Jet Boots,
 +
"NGS Ability Capsule",
 +
"NGS Tool",
 +
"NGS Music Disc",
 +
"NGS Pass",
 +
"NGS Material",
 +
"NGS Fruit",
 +
"NGS Meat",
 +
"NGS Mineral",
 +
"NGS Seafood",
 +
"NGS Vegetable",
 +
"NGS Booster",
 +
"NGS Consumable",
 +
"NGS Ticket"]</nowiki>
 +
<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 name 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": "Prim Sword",
 +
"required": true
 +
},
 +
"Amount": {
 +
"label": "Amount of Item",
 +
"description": "This is the amount of the item. If you only get one of the item, then ignore this. Optional.",
 +
"type": "number",
 +
"example": "50"
 +
}
 +
},
 +
"paramOrder": [
 +
"Icon",
 +
"RealName",
 +
"PageName",
 +
"Amount"
 +
]
 +
}
 +
</templatedata>
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 10:06, 9 October 2022

{{{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|PageName=Swords_(NGS)|RealName=Prim Sword}}

results in this:

Sword (NGS) Prim Sword.

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

Sword (NGS) Prim Sword.

You can also specify the amount of the item, which is great for items like Materials that you get multiple of for example, like N-Grinders.

{{NGSItem|Icon=NGS Tool|RealName=N-Grinder|Amount=50}}

Results in this:

Tool (NGS) N-Grinder ×50.

TODO

When suggested values are implement, add the following to the UI Icon entry: , "suggestedvalues": [ "NGS Sword", "NGS Partizan", "NGS Wired Lances", "NGS Double Saber", "NGS Knuckles", "NGS Twin Daggers", "NGS Gunslash", "NGS Dual Blades", "NGS Assault Rifle", "NGS Twin Machine Guns", "NGS Bullet Bow", "NGS Rod", "NGS Wand", "NGS Talis", "NGS Jet Boots, "NGS Ability Capsule", "NGS Tool", "NGS Music Disc", "NGS Pass", "NGS Material", "NGS Fruit", "NGS Meat", "NGS Mineral", "NGS Seafood", "NGS Vegetable", "NGS Booster", "NGS Consumable", "NGS Ticket"]

Use this template on NGS pages to display an item name that does not line-break. Optionally, a UI icon can be included.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
UI IconIcon

The small icon that is used in-game. This appears to the left of the item name.

Example
NGS Sword
Stringsuggested
Real NameRealName

This is the name of the item visible in-game. This is required.

Example
Prim Sword
Stringrequired
Page NamePageName

This is the page that clicking the name of the item will link to. If not specified, then the item name on the page will not have a link.

Example
Swords_(NGS)
Stringsuggested
Amount of ItemAmount

This is the amount of the item. If you only get one of the item, then ignore this. Optional.

Example
50
Numberoptional