Difference between revisions of "Template:RenderIngredient"

From DDO Compendium
 
(9 intermediate revisions by the same user not shown)
Line 24: Line 24:


{{#switch: {{lc:{{#dplvar:renderstyle}}}}
{{#switch: {{lc:{{#dplvar:renderstyle}}}}
|icononly={{#dplvar:ingcount}}x[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|{{{3|}}}|36px|x36px|{{{1}}}]]
|icononly=<div style="display:inline-block;position:relative">[[File:{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}_Icon.png|link={{#if: {{{3|}}}|{{{3}}}|{{{1}}}}}|{{{3|}}}|36px|x36px|{{#dplvar:ingcount}}x {{{1}}}]]<div style="font-size:12px;text-shadow:-1px -1px 0 #000000,1px -1px 0 #000000,-1px 1px 0 #000000,1px 1px 0 #000000;position:absolute;z-index:2;right:2px;bottom:0;width:100%;pointer-events:none;text-align:right;">{{#dplvar:ingcount}}</div></div>
|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>
|#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>

Latest revision as of 20:31, 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
  • alsdfj
5x Silver Flame Trinket
{{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}}
Has no Icon in database
Ingredient Scarab Icon.png 5x Dark Scarab Powder
{{RenderIngredient|Lily Petal|Lily Petal (Collectable)|Lily Petal (Collectable)}}5x Lily Petal
{{Ingredient|Thread of Fate|250}}
250x Thread of Fate
250

Usage[edit]

Parameter Documentation
titleThe Ingredient title
IconName of the icon, if not the same as the title
pageThe 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.


[[File:{{{1}}}_Icon.png|link={{{1}}}||36px|x36px|x {{{1}}}]]