Difference between revisions of "Template:Name"

From Stardew Valley Wiki
Jump to navigation Jump to search
(add a description parameter which will be print below the name. This and the image will be vertically aligned. the description can be on multiple lines using <br/>)
m (Reverted edits by ClemNad (talk) to last revision by Margotbean)
Line 1: Line 1:
<includeonly><span id="nametemplate" {{#ifeq:{{{class|}}}|inline|style="display:inline; margin-right:0;"|}}>{{#if:{{{description|}}}|<table style='display: inline-table; vertical-align: middle;'><td>|}}[[File:{{#if:{{{image|}}}|{{{image|}}}|{{{1|}}}.{{{ext|png}}}}}|{{#if:{{{size|}}}|{{{size|}}}|24}}px|link=]]{{#if:{{{description|}}}|</td><td>|}}
+
<includeonly><span id="nametemplate" {{#ifeq:{{{class|}}}|inline|style="display:inline; margin-right:0;"|}}>[[File:{{#if:{{{image|}}}|{{{image|}}}|{{{1|}}}.{{{ext|png}}}}}|{{#if:{{{size|}}}|{{{size|}}}|24}}px|link=]] {{#if:{{{link|}}}|[[{{{link|}}}]]|{{#switch:{{lc:{{{1|}}}}}
{{#if:{{{link|}}}|[[{{{link|}}}]]|{{#switch:{{lc:{{{1|}}}}}
 
 
|fishing treasure chest=[[Fishing#Treasure Chests|Fishing Treasure Chest]]
 
|fishing treasure chest=[[Fishing#Treasure Chests|Fishing Treasure Chest]]
 
|muscle remedy=[[Harvey's Clinic#Medical Supplies|Muscle Remedy]]
 
|muscle remedy=[[Harvey's Clinic#Medical Supplies|Muscle Remedy]]
Line 19: Line 18:
 
|copper pan=[[Copper Pan|Panning]]
 
|copper pan=[[Copper Pan|Panning]]
 
|trimmed lucky purple shorts=[[Secrets#Lucky Purple Shorts|Trimmed Lucky Purple Shorts]]
 
|trimmed lucky purple shorts=[[Secrets#Lucky Purple Shorts|Trimmed Lucky Purple Shorts]]
|#default=[[{{{1|}}}]]}}}}{{#if: {{{2|}}}|&nbsp;({{{2|}}})|}}{{#if:{{{description|}}}|<br/>{{{description|}}}</td></table>|}}</span></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>
+
|#default=[[{{{1|}}}]]}}}}{{#if: {{{2|}}}|&nbsp;({{{2|}}})|}}</span></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude>

Revision as of 20:09, 22 January 2021

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".

Use

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=48)
  • 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=48}}

Result: Apple.png Apple

{{name|Melon|3|size=48}}

Result: Melon.png Melon (3)

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

Result: Corn.png Grape (3)