Difference between revisions of "Template:RecipeInfobox"

From ChatWars Wiki
Jump to: navigation, search
m
(added recipeSource variable for entering an optional source argument to the template. if left out, template uses {{PAGENAME}} to show current page's recipe, if entered it shows recipe of target page)
Line 1: Line 1:
 +
{{#vardefine: recipeSource | {{{source|{{PAGENAME}}}}} }}
 
<div class="recipe_template">
 
<div class="recipe_template">
 
{| class="wikitable floatright" style="width:350px; font-size:100%;"
 
{| class="wikitable floatright" style="width:350px; font-size:100%;"
Line 4: Line 5:
 
| 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={{#show: {{PAGENAME}} |?CraftIcon}}}} '''Info:''' '''{{PAGENAME}}'''
 
|-
 
|-
{{#switch:{{#show: {{PAGENAME}} |?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]]'''
{{!}}  {{#show: {{PAGENAME}} |?SkillCraft}}
+
{{!}}  {{#show: {{#var: recipeSource}} |?SkillCraft}}
 
{{!}}-
 
{{!}}-
 
{{!}} style="text-align: right;  {{!}} '''Skill level required'''
 
{{!}} style="text-align: right;  {{!}} '''Skill level required'''
{{!}}  {{#show: {{PAGENAME}} |?SkillCraftLevel}}
+
{{!}}  {{#show: {{#var: recipeSource}} |?SkillCraftLevel}}
 
{{!}}-
 
{{!}}-
 
}}
 
}}
| style="text-align: right;" | '''Mana''' || {{#show: {{PAGENAME}} |?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: {{PAGENAME}} |?CraftCommand}}</code>
+
| style="text-align: right;" | '''Chatcommand''' || <code>{{#show: {{#var: recipeSource}} |?CraftCommand}}</code>
 
|-
 
|-
 
| colspan="2" style="background: lightgrey;  text-align:center"| '''Recipe'''  
 
| colspan="2" style="background: lightgrey;  text-align:center"| '''Recipe'''  
Line 22: Line 23:
 
|-
 
|-
 
{{#ask:
 
{{#ask:
  [[-Has subobject::{{PAGENAME}}]] [[Crafting ingredient.ItemType::Recipe (Item)]]
+
  [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::Recipe (Item)]]
 
  | mainlabel=-
 
  | mainlabel=-
 
  | headers=hide
 
  | headers=hide
Line 32: Line 33:
  
 
{{#ask:
 
{{#ask:
  [[-Has subobject::{{PAGENAME}}]] [[Crafting ingredient.ItemType::Piece of Equipment]]
+
  [[-Has subobject::{{#var: recipeSource}}]] [[Crafting ingredient.ItemType::Piece of Equipment]]
 
  | mainlabel=-
 
  | mainlabel=-
 
  | headers=hide
 
  | headers=hide
Line 42: Line 43:
  
 
{{#ask:  
 
{{#ask:  
  [[-Has subobject::{{PAGENAME}}]] [[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]]
 
  | mainlabel=-
 
  | mainlabel=-
 
  | headers=hide
 
  | headers=hide

Revision as of 11:32, 26 July 2018

Info: RecipeInfobox
Mana Mana.png
Chatcommand
Recipe
Ingredient Amount


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.