Template:Name/doc: Difference between revisions

From Dreamlight Valley Wiki
Jump to navigation Jump to search
(Created page with "==Description== This template is used to insert an image next to an article name, resize the image to 20px wide, create a link to the article, and a parameter to display quantity or other detail after the article name and link. Image size can be adjusted using the parameter "size". ==Usage== This template can be used by entering the following onto a relevant page. <pre>{{name|''item name''|''detail''}}</pre> ===Optional Parameters=== If used together with "detail" th...")
 
No edit summary
Line 28: Line 28:
{{name|Buzz Lightyear's Space Pack}}
{{name|Buzz Lightyear's Space Pack}}


====Optional Parameter Examples====
 
The ''detail'' parameter can be any value, including another template
; Optional Parameter Examples
 
The "detail" parameter can be any value, including another template
<pre>{{name|Donald Duck|{{price|100}}}}</pre>
<pre>{{name|Donald Duck|{{price|100}}}}</pre>
results in...
results in...

Revision as of 19:47, 18 March 2023

Description

This template is used to insert an image next to an article name, resize the image to 20px wide, create a link to the article, and a parameter to display quantity or other detail after the article name and link.

Image size can be adjusted using the parameter "size".

Usage

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

{{name|''item name''|''detail''}}

Optional Parameters

If used together with "detail" these should be entered after the detail value.

  • size=Adjust the width in px the image displays at (e.g. size=32)
  • image=Overrides the image matching the item name (e.g. image=Mickey Mouse.png)
  • link=Link to an alternative page

Examples

The most common use of this template doesn't define parameters by name, but by order.

{{name|Apple|5}}

results in...

Apple (5)

{{name|Buzz Lightyear's Space Pack}}

results in...

Buzz Lightyear's Space Pack


Optional Parameter Examples

The "detail" parameter can be any value, including another template

{{name|Donald Duck|{{price|100}}}}

results in...

Donald Duck (Star Coin icon.png 100)

The parameter "size" overrides the default (20px) image size

{{name|Wedding Cake|3|size=48}}

results in...

Wedding Cake (3)

Optional parameters can be used without a "detail" value

{{name|Scrooge McDuck|size=48}}

results in...

Scrooge McDuck

By default the image and link are the "name" value. Each can be overridden using named parameters "image" and "link".

{{name|Goofy|image=Mickey Mouse.png}}

results in...

Goofy

{{name|Goofy|link=Mickey Mouse}}

results in...

Mickey Mouse

Optional parameters can also be combined

{{name|Crab|3|size=36|link=:Category:Seafood{{!}}Seafood}}

results in...

Seafood (3)