Template:PM item: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{
<includeonly>{{#invoke:PM item|link
  #vardefine: game | {{{game|PM}}}
|game{{#ifeq:{{{game|}}}|{{{game}}}||NULL}}={{{game}}}
}}{{
|1{{#ifeq:{{{1|}}}|{{{1}}}||NULL}}={{{1}}}
  #vardefine: item | {{{2|{{{1}}}}}}
|2{{#ifeq:{{{2|}}}|{{{2}}}||NULL}}={{{2}}}
}}{{
|item{{#ifeq:{{{item|}}}|{{{item}}}||NULL}}={{{item}}}
  #vardefine: link | {{{link|{{{1}}}}}}
|size{{#ifeq:{{{size|}}}|{{{size}}}||NULL}}={{{size}}}
}}{{
|right{{#ifeq:{{{right|}}}|{{{right}}}||NULL}}={{{right}}}
  #vardefine: text | {{{text|{{#var:item}}}}}
|link{{#ifeq:{{{link|}}}|{{{link}}}||NULL}}={{{link}}}
}}{{
|text{{#ifeq:{{{text|}}}|{{{text}}}||NULL}}={{{text}}}
  #vardefine: image-prefix | {{
|color{{#ifeq:{{{color|}}}|{{{color}}}||NULL}}={{{color}}}
    #switch: {{#var:game}}
|wikitext{{#ifeq:{{{wikitext|}}}|{{{wikitext}}}||NULL}}={{{wikitext}}}
    | PM      = PaperMario Items&#32;
|sep{{#ifeq:{{{sep|}}}|{{{sep}}}||NULL}}={{{sep}}}
    | #default =
}}</includeonly><noinclude>
  }}
This template creates a page link related to ''[[Paper Mario]]'' with an associated item image on the left side.
}}{{
 
  #vardefine: image-suffix | {{
    #switch: {{#var:game}}
    | PM      =
    | PMTOK    = &#32;PMTOK icon
    | #default = &#32;{{#var:game}}
  }}
}}{{
  #vardefine: image-base | {{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{#replace:{{{item|{{#var:item}}}}}|×|x}}|.|}}|,|}}|'|}}|"|}}|?|}}|!|}}
}}{{
  #vardefine: image-base | {{
    #switch: {{#var:game}}
    | PM      = {{#replace:{{#var:image-base}}| |}}
    | PMTOK    = {{
      #switch: {{#var:image-base}}
      | Spring of Rainbows - VIP = Spring of Rainbows VIP
      | #default = {{#var:image-base}}
    }}
    | #default = {{#var:image-base}}
  }}
}}{{
  #vardefine: image | [[File:{{#var:image-prefix}}{{#var:image-base}}{{#var:image-suffix}}.png|{{
    #ifeq: {{{size|}}}
    | {{{size}}}
    | {{#if: {{{size}}}
      | {{{size}}}
      | &nbsp;
    }}
    | {{#switch: {{#var:game}}
      | TTYD    = 25x25px
      | PMTOK    = 50x50px
      | #default = &nbsp;
    }}
  }}|link={{#var:link}}]]
}}{{
  #vardefine: wikitext | {{{wikitext|{{
    #if: {{#var:text}}
    | {{#if: {{#var:link}}
      | {{#if: {{{color|}}}
        | {{color-link-piped|{{#var:link}}|{{{color}}}|{{#var:text}}}}
        | [[{{#var:link}}|{{#var:text}}]]
      }}
      | {{#if: {{{color|}}}
        | <span style="color:{{{color}}}">{{#var:text}}</span>
        | {{#var:text}}
      }}
    }}
  }}}}}
}}{{nowrap|{{
  #if: {{{right|}}}
  | {{#var:wikitext}}{{{sep| }}}{{#var:image}}
  | {{#var:image}}{{{sep| }}}{{#var:wikitext}}
}}}}</includeonly><noinclude>
{{/parameters|all=1}}
{{/parameters|all=1}}


== Examples ==
==Examples==
{| class="wikitable"
{| class="wikitable"
! Code
! Code
! Result
! Result
|-
|-
| <code><nowiki>{{PM item|Spaghetti}}</nowiki></code> || {{PM item|Spaghetti}}
| <code><nowiki>{{PM item|Spaghetti|link=Spaghetti Plate}}</nowiki></code> || {{PM item|Spaghetti|link=Spaghetti Plate}}
|-
|-
| <code><nowiki>{{PM item|Hot Shroom}}</nowiki></code> || {{PM item|Hot Shroom}}
| <code><nowiki>{{PM item|Hot Shroom}}</nowiki></code> || {{PM item|Hot Shroom}}
Line 95: Line 43:
| <code><nowiki>{{PM item|POW Block|link=|text=}}</nowiki></code> || {{PM item|POW Block|link=|text=}}
| <code><nowiki>{{PM item|POW Block|link=|text=}}</nowiki></code> || {{PM item|POW Block|link=|text=}}
|-
|-
| <code><nowiki>{{PM item|game=TTYD|Spaghetti}}</nowiki></code> || {{PM item|game=TTYD|Spaghetti}}
| <code><nowiki>{{PM item|game=TTYD|Spaghetti|link=Spaghetti Plate}}</nowiki></code> || {{PM item|game=TTYD|Spaghetti|link=Spaghetti Plate}}
|-
|-
| <code><nowiki>{{PM item|game=SPM|Spaghetti Plate}}</nowiki></code> || {{PM item|game=SPM|Spaghetti Plate}}
| <code><nowiki>{{PM item|game=SPM|Spaghetti Plate}}</nowiki></code> || {{PM item|game=SPM|Spaghetti Plate}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|Mushroom}}</nowiki></code> || {{PM item|game=PMTOK|Mushroom}}
| <code><nowiki>{{PM item|game=CS|Café Key}}</nowiki></code> || {{PM item|game=CS|Café Key}}
|-
| <code><nowiki>{{PM item|game=TOK|Mushroom}}</nowiki></code> || {{PM item|game=TOK|Mushroom}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|1-Up Mushroom}}</nowiki></code> || {{PM item|game=PMTOK|1-Up Mushroom}}
| <code><nowiki>{{PM item|game=TOK|1-Up Mushroom}}</nowiki></code> || {{PM item|game=TOK|1-Up Mushroom}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|Spring of Rainbows - VIP}}</nowiki></code> || {{PM item|game=PMTOK|Spring of Rainbows - VIP}}
| <code><nowiki>{{PM item|game=TOK|Spring of Rainbows - VIP}}</nowiki></code> || {{PM item|game=TOK|Spring of Rainbows - VIP}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|Key to Bowser's Castle}}</nowiki></code> || {{PM item|game=PMTOK|Key to Bowser's Castle}}
| <code><nowiki>{{PM item|game=TOK|Key to Bowser's Castle}}</nowiki></code> || {{PM item|game=TOK|Key to Bowser's Castle}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|"M-A-X Power!"}}</nowiki></code> || {{PM item|game=PMTOK|"M-A-X Power!"}}
| <code><nowiki>{{PM item|game=TOK|"M-A-X Power!"}}</nowiki></code> || {{PM item|game=TOK|"M-A-X Power!"}}
|-
|-
| <code><nowiki>{{PM item|game=PMTOK|"Deep, Deep Vibes"}}</nowiki></code> || {{PM item|game=PMTOK|"Deep, Deep Vibes"}}
| <code><nowiki>{{PM item|game=TOK|"Deep, Deep Vibes"}}</nowiki></code> || {{PM item|game=TOK|"Deep, Deep Vibes"}}
|}
|}


== See also ==
==See also==
* {{tem|TTYD item}}
*{{tem|PMTTYD item}}
* {{tem|SPM item}}
*{{tem|SPM item}}
*[[Module:PM item]]


[[Category:Formatting templates]]
[[Category:Content templates]]</noinclude>
</noinclude>

Latest revision as of 14:00, May 3, 2022

This template creates a page link related to Paper Mario with an associated item image on the left side.

Parameters

Name Usage
{{{1}}} Set the defaults for {{{item}}}, {{{link}}}, and {{{text}}}
{{{item}}} or {{{2}}} Set the item to be displayed
{{{size}}} Set the item image size
{{{right}}} Set the position of the item image
{{{link}}} Set the page to link
{{{text}}} Set the text to be displayed
{{{color}}} Set the text color
{{{wikitext}}} Override {{{text}}}
{{{sep}}} Set the separator between the item image and text
{{{game}}} PM (default), TTYD, SPM, CS, or TOK

Examples

Code Result
{{PM item|Spaghetti|link=Spaghetti Plate}} PaperMario Items Spaghetti.png Spaghetti
{{PM item|Hot Shroom}} PaperMario Items HotShroom.png Hot Shroom
{{PM item|Whacka's Bump|sep=<br>}} PaperMario Items WhackasBump.png
Whacka's Bump
{{PM item|Jammin' Jelly|text=Jammin' Jelly}} PaperMario Items JamminJelly.png Jammin' Jelly
{{PM item|Jammin' Jelly|wikitext=Jammin' Jelly}} PaperMario Items JamminJelly.png Jammin' Jelly
{{PM item|Mystery Box (item)|Mystery?}} PaperMario Items Mystery.png Mystery?
{{PM item|item=Mystery?|Mystery Box (item)}} PaperMario Items Mystery.png Mystery Box (item)
{{PM item|link=Mystery Box (item)|Mystery?}} PaperMario Items Mystery.png Mystery?
{{PM item|POW Block|link=}} PaperMario Items POWBlock.png POW Block
{{PM item|POW Block|text=}} PaperMario Items POWBlock.png
{{PM item|POW Block|link=|text=}} PaperMario Items POWBlock.png
{{PM item|game=TTYD|Spaghetti|link=Spaghetti Plate}} Spaghetti TTYD.png Spaghetti
{{PM item|game=SPM|Spaghetti Plate}} Spaghetti Plate SPM.png Spaghetti Plate
{{PM item|game=CS|Café Key}} The Café Key icon from Paper Mario: Color Splash Café Key
{{PM item|game=TOK|Mushroom}} An item from Paper Mario: The Origami King. Mushroom
{{PM item|game=TOK|1-Up Mushroom}} A 1-Up Mushroom from Paper Mario: The Origami King. 1-Up Mushroom
{{PM item|game=TOK|Spring of Rainbows - VIP}} An item from Paper Mario: The Origami King. Spring of Rainbows - VIP
{{PM item|game=TOK|Key to Bowser's Castle}} An item from Paper Mario: The Origami King. Key to Bowser's Castle
{{PM item|game=TOK|"M-A-X Power!"}} An item from Paper Mario: The Origami King. "M-A-X Power!"
{{PM item|game=TOK|"Deep, Deep Vibes"}} An item from Paper Mario: The Origami King. "Deep, Deep Vibes"

See also