Difference between revisions of "Template:Name/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
m
(Don't assume the size unit of measure is px.)
Line 7: Line 7:
 
This template can be used by entering the following onto a relevant page.
 
This template can be used by entering the following onto a relevant page.
  
<pre>{{name|''item name''|''amount''}}</pre>
+
<pre>{{Name|''item name''|''amount''}}</pre>
 
===Optional Parameters===
 
===Optional Parameters===
 
All Optional Parameters if used together with "quantity" should be placed after the quantity value!
 
All Optional Parameters if used together with "quantity" should be placed after the quantity value!
*size: the image size to be displayed (example: size=48)
+
*size: the image size to be displayed (example: size=48px)
 
*image: an alternative image to display (example: image=Angler.png)
 
*image: an alternative image to display (example: image=Angler.png)
 
*link: replace the name with a link to another page
 
*link: replace the name with a link to another page
 
*class: alternative classes. Currently there is only '''inline''' to suppress line break (example: class=inline)
 
*class: alternative classes. Currently there is only '''inline''' to suppress line break (example: class=inline)
 
==Examples==
 
==Examples==
<pre>{{name|Complete Breakfast|30}}</pre>
+
<pre>{{Name|Complete Breakfast|30}}</pre>
  
 
When used the parameters are not identified by name, but by order.  Example use of this template;
 
When used the parameters are not identified by name, but by order.  Example use of this template;
<pre>{{name|Corn|30}}</pre>
+
<pre>{{Name|Corn|30}}</pre>
Result: {{name|Corn|30}}
+
Result: {{Name|Corn|30}}
<pre>{{name|Preserves Jar|3}}</pre>
+
<pre>{{Name|Preserves Jar|3}}</pre>
Result: {{name|Preserves Jar|3}}
+
Result: {{Name|Preserves Jar|3}}
  
 
'''Optional parameter examples:'''
 
'''Optional parameter examples:'''
<pre>Crafting recipe unlocked at {{name|Mining|Level 9|class=inline}}.</pre>
+
<pre>Crafting recipe unlocked at {{Name|Mining|Level 9|class=inline}}.</pre>
Result: Crafting recipe unlocked at {{name|Mining|Level 9|class=inline}}.
+
Result: Crafting recipe unlocked at {{Name|Mining|Level 9|class=inline}}.
  
 
Size can be defined by using the named parameter "size":
 
Size can be defined by using the named parameter "size":
<pre>{{name|Apple|size=48}}</pre>
+
<pre>{{Name|Apple|size=48px}}</pre>
Result: {{name|Apple|size=48}}
+
Result: {{Name|Apple|size=48px}}
  
 
If the size parameter is used together with quantity it should be placed after the quantity number:
 
If the size parameter is used together with quantity it should be placed after the quantity number:
<pre>{{name|Melon|3|size=48}}</pre>
+
<pre>{{Name|Melon|3|size=48px}}</pre>
Result: {{name|Melon|3|size=48}}
+
Result: {{Name|Melon|3|size=48px}}
  
 
If the image parameter is used together with quantity it should be placed after the quantity number:
 
If the image parameter is used together with quantity it should be placed after the quantity number:
<pre>{{name|Grape|3|image=Hops.png}}</pre>
+
<pre>{{Name|Grape|3|image=Hops.png}}</pre>
Result: {{name|Grape|3|image=Hops.png}}
+
Result: {{Name|Grape|3|image=Hops.png}}
  
 
If the link parameter is used together with quantity it should be placed after the quantity number:
 
If the link parameter is used together with quantity it should be placed after the quantity number:
<pre>{{name|Corn|3|link=Grape}}</pre>
+
<pre>{{Name|Corn|3|link=Grape}}</pre>
Result: {{name|Corn|3|link=Grape}}
+
Result: {{Name|Corn|3|link=Grape}}
  
 
It's also possible to use multiple optional parameters:
 
It's also possible to use multiple optional parameters:
<pre>{{name|Grape|3|image=Hops.png|size=64|class=inline}}.</pre>
+
<pre>{{Name|Grape|3|image=Hops.png|size=64px|class=inline}}.</pre>
{{name|Grape|3|image=Hops.png|size=64|class=inline}}.
+
{{Name|Grape|3|image=Hops.png|size=64px|class=inline}}.
 
<includeonly>[[Category:Transclusion templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>[[Category:Transclusion templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>
 
<includeonly>[[de:Vorlage:{{PAGENAME}}]]
 
<includeonly>[[de:Vorlage:{{PAGENAME}}]]

Revision as of 01:16, 28 February 2017

Description

This template is used to place the picture of a named item next to the name, resizes the image to 24px wide, makes the item name a link if there's an available article of the same name, and lastly places the third parameter in parenthesis to signify quantity, relationship or any other secondary detail. To refer to villagers and NPCs, use Template:NPC.

Image size can be adjusted by adding the parameter "size".

Usage

This template can be used by entering the following onto a relevant page.

{{Name|''item name''|''amount''}}

Optional Parameters

All Optional Parameters if used together with "quantity" should be placed after the quantity value!

  • size: the image size to be displayed (example: size=48px)
  • image: an alternative image to display (example: image=Angler.png)
  • link: replace the name with a link to another page
  • class: alternative classes. Currently there is only inline to suppress line break (example: class=inline)

Examples

{{Name|Complete Breakfast|30}}

When used the parameters are not identified by name, but by order. Example use of this template;

{{Name|Corn|30}}

Result: Corn.png Corn (30)

{{Name|Preserves Jar|3}}

Result: Preserves Jar.png Preserves Jar (3)

Optional parameter examples:

Crafting recipe unlocked at {{Name|Mining|Level 9|class=inline}}.

Result: Crafting recipe unlocked at Mining.png Mining (Level 9).

Size can be defined by using the named parameter "size":

{{Name|Apple|size=48px}}

Result: Apple.png Apple

If the size parameter is used together with quantity it should be placed after the quantity number:

{{Name|Melon|3|size=48px}}

Result: Melon.png Melon (3)

If the image parameter is used together with quantity it should be placed after the quantity number:

{{Name|Grape|3|image=Hops.png}}

Result: Grape.png Grape (3)

If the link parameter is used together with quantity it should be placed after the quantity number:

{{Name|Corn|3|link=Grape}}

Result: Corn.png Grape (3)

It's also possible to use multiple optional parameters:

{{Name|Grape|3|image=Hops.png|size=64px|class=inline}}.

Grape.png Grape (3).