Difference between revisions of "Template:Overlayimg"
Jump to navigation
Jump to search
Margotbean (talk | contribs) (new) |
Margotbean (talk | contribs) |
||
Line 1: | Line 1: | ||
− | <includeonly><templatestyles src="Template:Overlayimg/styles.css" /><div class="parent" style="width: {{{width|24}}}px; height: auto; {{#ifeq:{{lc:{{{center|}}}}}|true|margin: 0 auto;|}}"><div class="{{#switch:{{lc:{{{type|}}}}}| | + | <includeonly><templatestyles src="Template:Overlayimg/styles.css" /><div class="parent" style="width: {{{width|24}}}px; height: auto; {{#ifeq:{{lc:{{{center|}}}}}|true|margin: 0 auto;|}}"><div class="{{#switch:{{lc:{{{type|}}}}}|star=backimage|#default=backimagetransparent}}">[[File:{{{1|Blank icon}}}.png|{{{width|24}}}px|link=]]</div><div class="foreimage">{{#switch:{{lc:{{{type|}}}}} |
|recipe=[[File:Recipe Overlay.png{{!}}{{#switch:{{{width|24}}} | |recipe=[[File:Recipe Overlay.png{{!}}{{#switch:{{{width|24}}} | ||
− | + | |48=48 | |
− | + | |#default={{#expr:{{{width|24}}}+8}}px}}{{!}}link=]] | |
|star={{#switch:{{lc:{{{quality|0}}}}} | |star={{#switch:{{lc:{{{quality|0}}}}} | ||
|4|iridium=[[File:Iridium Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | |4|iridium=[[File:Iridium Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | ||
|2|gold=[[File:Gold Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | |2|gold=[[File:Gold Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | ||
|1|silver=[[File:Silver Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | |1|silver=[[File:Silver Quality Icon.png{{!}}{{{width|24}}}px{{!}}link=]] | ||
− | + | |0|#default=}} | |
− | |#default=[[File: | + | |#default={{#switch:{{NAMESPACE}}|{{ns:Template}}=|#default=[[File:{{{type|}}} Overlay.png{{!}}{{{width|24}}}px{{!}}link=]]}}}}</div></div></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> |
− | </div></div></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> |
Revision as of 21:10, 16 March 2023
Description
This template overlays one image on top of another. It can be called directly, but is also used by Template:Recipe and Template:Quality.
Parameters
Parameter | Required | Notes |
---|---|---|
First (unnamed) parameter | Yes | Name of background image (without extension such as .png) |
type | Yes | Type of foreground image. Valid values: Aged Roe, Honey, Jelly, Juice, Pickles, Recipe, Star, Wine All values other than star are used to produce an image, and are case-sensitive. |
width | No | Desired display width of background image (do not include "px") Valid values: 48, 36, 32, 24 (other values will be accepted, but may produce undesired results) Default value: 24 |
quality | No | If type=star, this parameter specifies the quality star to use. Valid values: 4, Iridium, 2, Gold, 1, Silver, 0. (Case insensitive) If type=star and this parameter is omitted, quality is assumed to be normal/base (no-star) quality. This parameter should be omitted for any type other than star. |
center | No | If the image is to be displayed in a table cell, then setting center=true will center the image inside the cell. |
Examples
Template Call | Result |
---|---|
{{Overlayimg|Parsnip|type=star|quality=silver|width=36}}
|
|
{{Overlayimg|Parsnip|type=star|quality=gold|width=36|center=true}}
|
|
{{Overlayimg|Fish Stew|type=Recipe}}
|
|
{{Overlayimg|Autumn's Bounty|type=Recipe|width=48|center=true}}
|
|
{{Overlayimg|Wicked Statue|type=Recipe|width=36|center=true}}
|