Difference between revisions of "Template:RecipeInfobox"

From ChatWars Wiki
Jump to: navigation, search
m
(add cooking skill as known skill)
 
(18 intermediate revisions by the same user not shown)
Line 19: 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}} |?CraftCommand}}</code>
+
| 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'''  
Line 44: Line 49:
 
  |? Qty
 
  |? Qty
 
}}
 
}}
<!--this line is for supporting the personalized ingredient sets (it filters out the personalised one in the normal list, need to have a separate query for showing the personalised ones. THIS CAN ONLY BE USED ONCE ALL ITEM PAGES WITH RECIPES HAVE BEEN OPENED IN THE FORM EDIT AND THEN SAVED SO THE NEW DATA GETS POPULATED!!! [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::!Recipe (Item)]] [[Crafting ingredient.ItemType::!Piece of Equipment]] [[Personalized::No]]-->
+
 
 
{{#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 56: Line 61:
 
  |? Qty
 
  |? Qty
 
}}
 
}}
 
+
{{#ifeq: {{#var: incomplete}} | true
 +
  | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 +
{{!}}-
 +
}}
 
{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[Personalized::Yes]] }}
 
{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[Personalized::Yes]] }}
 
   | {{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::1]] }}
 
   | {{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::1]] }}
      | {{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #1'''
 
 
       | {{!}}-
 
       | {{!}}-
      | {{!}} colspan="2" style="text-align: center;" {{!}} ''1 of this list (player specific)''
+
<!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #1'''<br>''1 of this list (player specific)''
 
<!-- -->{{!}}-
 
<!-- -->{{!}}-
 
<!-- -->{{#ask:  
 
<!-- -->{{#ask:  
Line 73: Line 80:
 
           |? Crafting ingredient
 
           |? Crafting ingredient
 
           |? Qty
 
           |? Qty
         }}
+
         }}{{#ifeq: {{#var: incomplete}} | true
 +
            | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 +
<!--      -->{{!}}-
 +
          }}
 
     }}<!--
 
     }}<!--
 
  -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::2]] }}
 
  -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::2]] }}
       | {{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #2'''
+
       | {{!}}-
 +
<!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #2'''<br>''1 of this list (player specific)''
 
<!-- -->{{!}}-
 
<!-- -->{{!}}-
 
<!-- -->{{#ask:  
 
<!-- -->{{#ask:  
Line 88: Line 99:
 
           |? Crafting ingredient
 
           |? Crafting ingredient
 
           |? Qty
 
           |? Qty
         }}
+
         }}{{#ifeq: {{#var: incomplete}} | true
 +
            | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 +
<!--      -->{{!}}-
 +
          }}
 
     }}<!--
 
     }}<!--
 
  -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::3]] }}
 
  -->{{#if: {{#ask: [[-Has subobject::{{#var: recipeSource}}]] [[PersonalizedSetNr::3]] }}
       | {{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #3'''
+
       | {{!}}-
 +
<!-- -->{{!}} colspan="2" style="text-align: center;" {{!}} '''Personalized Ingredient Set #3'''<br>''1 of this list (player specific)''
 
<!-- -->{{!}}-
 
<!-- -->{{!}}-
 
<!-- -->{{#ask:  
 
<!-- -->{{#ask:  
Line 103: Line 118:
 
           |? Crafting ingredient
 
           |? Crafting ingredient
 
           |? Qty
 
           |? Qty
         }}
+
         }}{{#ifeq: {{#var: incomplete}} | true
 +
            | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 +
<!--      -->{{!}}-
 +
          }}
 
     }}
 
     }}
}}
 
 
{{#ifeq: {{#var: incomplete}} | true
 
  | {{!}} style="text-align: right;" {{!}} [[??]] ([[??]]) {{!}}{{!}} [[??]]
 
 
}}
 
}}
 
|}</div><!--COMMENTED OUT, IS END TAG FOR CUSTOM TOGGLE FOR COLLAPSE/EXPAND</div>-->
 
|}</div><!--COMMENTED OUT, IS END TAG FOR CUSTOM TOGGLE FOR COLLAPSE/EXPAND</div>-->

Latest revision as of 20:27, 9 December 2021

Info: RecipeInfobox
Mana Mana.png
Chatcommand Unknown craft skill encountered!
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.