Difference between revisions of "Template:RecipeInfobox"
(add cooking skill as known skill) |
|||
(77 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{#vardefine: recipeSource | {{{source|{{PAGENAME}}}}} }}<!-- | + | {{#vardefine: recipeSource | {{ReplaceNumericCharEncoding | string = {{{source|{{PAGENAME}} }}} }} }}{{#vardefine: incomplete | {{#show: {{#var: recipeSource}} | ?BoolRecipeIncomplete }} }}<!-- |
− | -->{{# | + | -->{{#vardefine: alignment | float{{{align|right}}} }}<!-- |
− | --><div class="recipe_template"> | + | -->{{#vardefine: collaps | {{#ifeq: {{{collapsible|}}} | true | mw-collapsible mw-collapsed" data-expandtext="Show Recipe" data-collapsetext="Hide Recipe" style="white-space: nowrap; display: inline-block<!--SEE CAPS LOCKED COMMENT IN NEXT LINE " id="mw-customcollapsible-recipeCollaps"--> | }} }}<!-- |
+ | --><!--THIS IS COMMENTED OUT BECAUSE IT SHOULD WORK, BUT IT DOESN'T DUE TO WHAT'S *PROBABLY* A BUG {{#if: {{{collapsible|}}} | <div class="mw-customtoggle-recipeCollaps" style="cursor:pointer; color:highlight">(Toggle Recipe)</div> }}--> | ||
+ | <div class="recipe_template {{#var: collaps}}"> | ||
{| class="wikitable {{#var: alignment}}" style="width:350px; font-size:100%;" | {| class="wikitable {{#var: alignment}}" style="width:350px; font-size:100%;" | ||
|- | |- | ||
− | | colspan="2" style="background: lightgrey; text-align:center"| {{Emoticon|emoticon={{#show: {{ | + | | colspan="2" style="background: lightgrey; text-align:center"| {{Emoticon|emoticon={{#switch: {{#show: {{#var: recipeSource}} |?SkillCraft#}} | Crafting (Skill) = Workshop | Alchemy (Skill) = Alchemy }} }} '''Info:''' '''{{#var: recipeSource}}'''<br>{{#ifeq: {{#var: incomplete}} | true | {{Emoticon|emoticon=Exclamationmark}}'''ATTENTION: Recipe is incomplete'''{{Emoticon|emoticon=Exclamationmark}} }} |
|- | |- | ||
− | {{#switch:{{#show: {{#var: recipeSource}} |?SkillCraft#}} | + | {{#switch: {{#show: {{#var: recipeSource}} |?SkillCraft#}} |
|Crafting (Skill) | Alchemy (Skill) = | |Crafting (Skill) | Alchemy (Skill) = | ||
{{!}} style="text-align: right; {{!}} '''Corresponding [[Skill]]''' | {{!}} style="text-align: right; {{!}} '''Corresponding [[Skill]]''' | ||
Line 17: | Line 19: | ||
| style="text-align: right;" | '''Mana''' || {{#show: {{#var: recipeSource}} |?ManaCrafting}} [[Image:Mana.png|16px]] | | style="text-align: right;" | '''Mana''' || {{#show: {{#var: recipeSource}} |?ManaCrafting}} [[Image:Mana.png|16px]] | ||
|- | |- | ||
− | | style="text-align: right;" | '''Chatcommand''' || <code>{{#show: {{#var: recipeSource}} |? | + | | style="text-align: right;" | '''Chatcommand''' || {{#switch: {{#show: {{#var: recipeSource}} |?SkillCraft#}} |
+ | | Alchemy (Skill) = <code>/b_{{#show: {{#var: recipeSource}} |?ItemID}}</code> | ||
+ | | Crafting (Skill) = <code>/c_{{#show: {{#var: recipeSource}} |?ItemID}}</code> | ||
+ | | Cooking (Skill) = <code>/cook_XYZ</code> | ||
+ | | #default = Unknown craft skill encountered! | ||
+ | }} | ||
|- | |- | ||
| colspan="2" style="background: lightgrey; text-align:center"| '''Recipe''' | | colspan="2" style="background: lightgrey; text-align:center"| '''Recipe''' | ||
|- | |- | ||
− | | style="text-align: right;" | '''Ingredient''' || '''Amount''' | + | | style="text-align: right;" | '''Ingredient (ID)''' || '''Amount''' |
|- | |- | ||
{{#ask: | {{#ask: | ||
Line 44: | Line 51: | ||
{{#ask: | {{#ask: | ||
− | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] | + | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] [[Personalized::No]] |
| mainlabel=- | | mainlabel=- | ||
| headers=hide | | headers=hide | ||
Line 54: | Line 61: | ||
|? Qty | |? Qty | ||
}} | }} | ||
− | + | {{#ifeq: {{#var: incomplete}} | true | |
− | |} | + | | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]] |
− | </div> | + | {{!}}- |
+ | }} | ||
+ | {{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[Personalized::Yes]] }} | ||
+ | | {{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::1]] }} | ||
+ | | {{!}}- | ||
+ | <!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #1'''<br>''1 of this list (player specific)'' | ||
+ | <!-- -->{{!}}- | ||
+ | <!-- -->{{#ask: | ||
+ | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] [[Personalized::Yes]] [[PersonalizedSetNr::1]] | ||
+ | |mainlabel=- | ||
+ | |headers=hide | ||
+ | |format=list | ||
+ | |template=RecipeRow | ||
+ | |sort=Qty | ||
+ | |order=desc | ||
+ | |? Crafting ingredient | ||
+ | |? Qty | ||
+ | }}{{#ifeq: {{#var: incomplete}} | true | ||
+ | | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]] | ||
+ | <!-- -->{{!}}- | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::2]] }} | ||
+ | | {{!}}- | ||
+ | <!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #2'''<br>''1 of this list (player specific)'' | ||
+ | <!-- -->{{!}}- | ||
+ | <!-- -->{{#ask: | ||
+ | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] [[Personalized::Yes]] [[PersonalizedSetNr::2]] | ||
+ | |mainlabel=- | ||
+ | |headers=hide | ||
+ | |format=list | ||
+ | |template=RecipeRow | ||
+ | |sort=Qty | ||
+ | |order=desc | ||
+ | |? Crafting ingredient | ||
+ | |? Qty | ||
+ | }}{{#ifeq: {{#var: incomplete}} | true | ||
+ | | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]] | ||
+ | <!-- -->{{!}}- | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::3]] }} | ||
+ | | {{!}}- | ||
+ | <!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #3'''<br>''1 of this list (player specific)'' | ||
+ | <!-- -->{{!}}- | ||
+ | <!-- -->{{#ask: | ||
+ | [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] [[Personalized::Yes]] [[PersonalizedSetNr::3]] | ||
+ | |mainlabel=- | ||
+ | |headers=hide | ||
+ | |format=list | ||
+ | |template=RecipeRow | ||
+ | |sort=Qty | ||
+ | |order=desc | ||
+ | |? Crafting ingredient | ||
+ | |? Qty | ||
+ | }}{{#ifeq: {{#var: incomplete}} | true | ||
+ | | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]] | ||
+ | <!-- -->{{!}}- | ||
+ | }} | ||
+ | }} | ||
+ | }} | ||
+ | |}</div><!--COMMENTED OUT, IS END TAG FOR CUSTOM TOGGLE FOR COLLAPSE/EXPAND</div>--> | ||
<noinclude> | <noinclude> | ||
__NOTOC__ | __NOTOC__ | ||
=Documentation= | =Documentation= | ||
− | The template is used to create a table with an overview for crafting/brewing recipes. Using the template results in a table on the right hand side of the page, text wrapping around. It is advised to put that template directly in the beginning of a page to get the recipe as infobox. | + | The template is used to create a table with an overview for crafting/brewing recipes. The template can be used in two modes: |
+ | * ''No arguments:'' Using the template results in a table on the right hand side of the page, text wrapping around. It is advised to put that template directly in the beginning of a page to get the recipe as infobox. | ||
+ | * ''Using arguments:'' possible arguments are <code>source</code>, <code>align</code> and <code>collapsible</code>. <code>source</code> defines which page the template should fetch the recipe from (default <nowiki>{{PAGENAME}}</nowiki>); <code>alignment</code> defines to where the table should be aligned (default: right); <code>collapsible</code> makes the table collapse (collapsed per default) with an [Expand]/[Collapse] button (default: empty, use "true" for activating). While the arguments can be mixed however you want (for example to just show the recipe of page X on page Y), but they have been made to be used in the Usage lists ([[Template:UsageList]] & [[Template:UsageListRow]]). There the template gets the arguments source=$AllItemPagesUsingThatResource (several <nowiki>{{PAGENAME}}</nowiki>), align=left, collapsible=true. | ||
− | |||
− | |||
[[Category:Template]] | [[Category:Template]] | ||
</noinclude> | </noinclude> |
Latest revision as of 21:27, 9 December 2021
Documentation
The template is used to create a table with an overview for crafting/brewing recipes. The template can be used in two modes:
- No arguments: Using the template results in a table on the right hand side of the page, text wrapping around. It is advised to put that template directly in the beginning of a page to get the recipe as infobox.
- Using arguments: possible arguments are
source
,align
andcollapsible
.source
defines which page the template should fetch the recipe from (default {{PAGENAME}});alignment
defines to where the table should be aligned (default: right);collapsible
makes the table collapse (collapsed per default) with an [Expand]/[Collapse] button (default: empty, use "true" for activating). While the arguments can be mixed however you want (for example to just show the recipe of page X on page Y), but they have been made to be used in the Usage lists (Template:UsageList & Template:UsageListRow). There the template gets the arguments source=$AllItemPagesUsingThatResource (several {{PAGENAME}}), align=left, collapsible=true.