Difference between revisions of "Template:RecipeInfobox"

From ChatWars Wiki
Jump to: navigation, search
(minor formatting change)
(18 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}}} }}<!--
 
-->{{#vardefine: alignment | float{{{align|right}}} }}<!--
 
-->{{#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"--> | }} }}<!--
 
-->{{#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"--> | }} }}<!--
Line 6: Line 6:
 
{| 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: {{PAGENAME}} |?CraftIcon}}}} '''Info:''' '''{{PAGENAME}}'''
+
| 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 23: Line 23:
 
| 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 55: Line 55:
 
  |? Crafting ingredient
 
  |? Crafting ingredient
 
  |? Qty
 
  |? Qty
 +
}}
 +
 +
{{#ifeq: {{#var: incomplete}} | true
 +
  | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 
}}
 
}}
  

Revision as of 02:40, 18 March 2019

Info: RecipeInfobox
Mana Mana.png
Chatcommand
Recipe
Ingredient (ID) Amount


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 and collapsible. 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.