Difference between revisions of "Template:RenderIngredient"
From DDO Compendium
MNDeveloper (talk | contribs) |
MNDeveloper (talk | contribs) |
||
(11 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
|usesnamedparameters = no | |usesnamedparameters = no | ||
|example1 = <nowiki>{{RenderIngredient|Silver Flame Trinket}}</nowiki> | |example1 = <nowiki>{{RenderIngredient|Silver Flame Trinket}}</nowiki> | ||
|example1output = {{#dplvar:set|ingcount|5}}{{RenderIngredient|Silver Flame Trinket}} | |example1output = {{#dplvar:set|ingcount|5}} | ||
* oajdflasdf | |||
* alsdfj | |||
* {{RenderIngredient|Silver Flame Trinket}} | |||
|example2 = <nowiki>{{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}}</nowiki><br>Has no Icon in database | |example2 = <nowiki>{{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}}</nowiki><br>Has no Icon in database | ||
|example2output = {{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}} | |example2output = {{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}} | ||
|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 18: | 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=<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> | |||
|#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
|
{{RenderIngredient|Dark Scarab Powder|Ingredient Scarab}} Has no Icon in database | ![]() |
{{RenderIngredient|Lily Petal|Lily Petal (Collectable)|Lily Petal (Collectable)}} | 5x Lily Petal |
{{Ingredient|Thread of Fate|250}} |
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.
[[File:{{{1}}}_Icon.png|link={{{1}}}||36px|x36px|x {{{1}}}]]