Difference between revisions of "Template:RenderIngredient"
From DDO Compendium
MNDeveloper (talk | contribs) |
MNDeveloper (talk | contribs) |
||
Line 13: | Line 13: | ||
|example3 = <nowiki>{{RenderIngredient|Lily Petal|Lily Petal (Collectable)|Lily Petal (Collectable)}}</nowiki> | |example3 = <nowiki>{{RenderIngredient|Lily Petal|Lily Petal (Collectable)|Lily Petal (Collectable)}}</nowiki> | ||
|example3output = {{RenderIngredient|Lily Petal|Lily Petal|Lily Petal (Collectable)}} | |example3output = {{RenderIngredient|Lily Petal|Lily Petal|Lily Petal (Collectable)}} | ||
|example4 = <nowiki>{{ | |example4 = <nowiki>{{Ingredient|Thread of Fate|250}}</nowiki> | ||
|example4output = {{#dplvar:set|ingcount|250}}{{ | |example4output = {{#dplvar:set|ingcount|250|renderstyle|icononly}}{{Ingredient|Thread of Fate|250}} | ||
|parameter1name = title | |parameter1name = title | ||
|parameter1description = The Ingredient title | |parameter1description = The Ingredient title | ||
Line 21: | Line 21: | ||
|parameter3name = page | |parameter3name = page | ||
|parameter3description = The page name, if not the same as the title. | |parameter3description = The page name, if not the same as the title. | ||
}}</noinclude><onlyinclude>{{#ifexist: File:{{#if: {{{2|}}}|{{{2|}}}|{{{1}}}}}_Icon.png|[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|36px|x36px|]]}} {{#dplvar:ingcount}}x {{PageLink|{{{1}}}|{{{3|}}}}}</onlyinclude> | }}</noinclude><onlyinclude>{{#dplvar:set|filepath|{{filepath:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png}}}} | ||
{{#switch: {{lc:{{#dplvar:renderstyle}}}} | |||
|icononly={{#dplvar:ingcount}}x[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|{{{3|}}}|36px|x36px|{{{1}}}]] | |||
|testing={{#ifexist: File:{{#if: {{{2|}}}|{{{2|}}}|{{{1}}}}}_Icon.png| | |||
<div style="position: relative; background: url({{#dplvar:filepath}}); width: 36px; height: 36px;"> | |||
{{filepath:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png}} | |||
<div style="position: absolute; bottom: 0; left: 0.5em; width: 36px; font-weight: bold; color: #fff;"> | |||
{{#dplvar:ingcount}} | |||
</div> | |||
<p style="position: absolute; top: 1em; right: 2em; width: 120px; padding: 4px; background-color: #fff; font-weight: bold; font-size: 11px;"> | |||
(text to appear at the top right of the image) | |||
</p> | |||
</div> | |||
{{#dplvar:ingcount}}x[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|{{{3|}}}|36px|x36px|{{{1}}}]] | |||
<table width="36px" height="36px" background="{{#dplvar:filepath}}" cellpadding="5" cellspacing="0"><tr><td valign="bottom" align="right"><font color="#ffffff">{{#dplvar:ingcount}}</font></td></tr></table>}} | |||
|#default={{#ifexist: File:{{#if: {{{2|}}}|{{{2|}}}|{{{1}}}}}_Icon.png|[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|36px|x36px|]]}} {{#dplvar:ingcount}}x {{PageLink|{{{1}}}|{{{3|}}}}}}}</onlyinclude> |
Revision as of 12:09, 18 October 2021
RenderIngredient[edit]
Template for a consistent appearance of ingredients in recipes, used by the main templates.
Example Usage | |
{{RenderIngredient|Silver Flame Trinket}} | * oajdflasdf
|
{{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}} Has no Icon in database | 5x Dark Scarab Powder |
{{RenderIngredient|Lily Petal|Lily Petal (Collectable)|Lily Petal (Collectable)}} | 5x Lily Petal |
{{Ingredient|Thread of Fate|250}} | 250x |
Usage[edit]
Parameter Documentation | |
title | The Ingredient title |
Icon | Name of the icon, if not the same as the title |
page | The page name, if not the same as the title. |
Template
Ignore any errors below this line, The errors occur because there is no input into the template, in the template itself.
x[[File:{{{1}}}_Icon.png|link={{{1}}}||36px|x36px|{{{1}}}]]