Template:Recipe: Difference between revisions

From Project Gorgon
Jump to navigation Jump to search
Alleryn (talk | contribs)
fixed (hopefully) forgotten RecipeToItem -> RecipeToItem<letter> changes from yesterday's attempt at performance improvement via branching the switch
Alleryn (talk | contribs)
v349
Line 1: Line 1:
<noinclude>
<noinclude>
<!-- v341 -->  
<!-- v341 -->  
<!-- Note there are currently no recipe names, including itemrecipe names that start with any of the letters K, V, X, Y, or Z.
<!-- Note there are currently no recipe names, including itemrecipe names that start with any of the letters K, X, Y, or Z.
If a recipe starting with one of those letters is added that isn't an itemrecipe, the syntactical pattern for that part of the switch will be a little different,
If a recipe starting with one of those letters is added that isn't an itemrecipe, the syntactical pattern for that part of the switch will be a little different,
as you will want to bypass the Template:RecipeToItem/<letter> subtemplate -->
as you will want to bypass the Template:RecipeToItem/<letter> subtemplate -->
Line 115: Line 115:
   | Dye Metal Armor (1 color)
   | Dye Metal Armor (1 color)
   | Dye Metal Armor (2 colors)
   | Dye Metal Armor (2 colors)
   | Dye Metal Armor (3 colors) = [[Blacksmithing|{{{1}}}]]  
   | Dye Metal Armor (3 colors) = [[Blacksmithing|{{{1}}}]]
  | Dye Making: Dye My Rabbity Fur Blue = [[Dye Making|{{{1}}}]]
   | Deep Bear Chest Infusion
   | Deep Bear Chest Infusion
   | Deep Boar Foot Infusion
   | Deep Boar Foot Infusion
Line 392: Line 393:
   | Undo Augment on Necklace = [[Augmentation|{{{1}}}]]
   | Undo Augment on Necklace = [[Augmentation|{{{1}}}]]
   | #default = <span class="extimage32px">{{Item icon|{{RecipeToItem/U|{{{1}}}}}}}</span> [[{{#replace:{{RecipeToItem/U|{{{1}}}}}|#|}}|{{{1}}}]]}}  
   | #default = <span class="extimage32px">{{Item icon|{{RecipeToItem/U|{{{1}}}}}}}</span> [[{{#replace:{{RecipeToItem/U|{{{1}}}}}|#|}}|{{{1}}}]]}}  
| v = {{#switch: {{{1}}} 
  | #default = <span class="extimage32px">{{Item icon|{{RecipeToItem/V|{{{1}}}}}}}</span>
  | w = {{#switch: {{{1}}}   
  | w = {{#switch: {{{1}}}   
   | Word of Power
   | Word of Power

Revision as of 21:36, 27 September 2021


Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]


Description

Takes the name of a recipe. as found in-game in the crafting menu or an NPC's training menu, or in the "Name" field in recipes.json (at http://cdn.projectgorgon.com) and outputs a link and sometimes an icon:

  • If the recipe produces an item, the template outputs that icon's icon and a link to the item page. Uses a helper template for each letter, e.g. Template:RecipeToItem/A.
  • Otherwise the template outputs no icon and a link to a relevant page, usually the page of the skill-line, with a few exceptions (for example the apply augment recipes link to Augmentation instead of Lore).

Syntax

  • {{Recipe|recipeName}}
  • or, to omit the leading scroll icon and "Recipe:" text:
    {{Recipe|recipeName|noscroll}}

Parameters

  • First parameter (required): The exact name of the recipe.
  • Second parameter (optional): If this parameter is present (can be any non-empty string), the leading scroll icon and "Recipe:" text are omitted.

Example

Example 1 Code

{{Recipe|Whisky (Drinkable Cask)}}

Example 1 Output

icon_4003.png Recipe: {{#switch: w

| a = Error: Item not found Whisky (Drinkable Cask)
| b = Error: Item not found Whisky (Drinkable Cask)
| c = Error: Item not found Whisky (Drinkable Cask)
| d = Error: Item not found Whisky (Drinkable Cask) 
| e = Error: Item not found Whisky (Drinkable Cask)
| f = Error: Item not found Whisky (Drinkable Cask)
| g = Error: Item not found Whisky (Drinkable Cask)
| h = Error: Item not found Whisky (Drinkable Cask)
| i = Error: Item not found Whisky (Drinkable Cask)
| j = Error: Item not found Whisky (Drinkable Cask)
| l = Error: Item not found Whisky (Drinkable Cask)
| m = Error: Item not found Whisky (Drinkable Cask)
| n = Error: Item not found Whisky (Drinkable Cask)
| o = Error: Item not found Whisky (Drinkable Cask)
| p = Error: Item not found Whisky (Drinkable Cask)
| q = Error: Item not found Whisky (Drinkable Cask)
| r = Error: Item not found Whisky (Drinkable Cask) 
| s = Error: Item not found Whisky (Drinkable Cask)
| t = Error: Item not found Whisky (Drinkable Cask) 
| u = Error: Item not found Whisky (Drinkable Cask) 
| v = Whisky (Drinkable Cask)

Example 2 Code

{{Recipe|Whisky (Drinkable Cask)|x}}

Example 2 Output

{{#switch: w

| a = Error: Item not found Whisky (Drinkable Cask)
| b = Error: Item not found Whisky (Drinkable Cask)
| c = Error: Item not found Whisky (Drinkable Cask)
| d = Error: Item not found Whisky (Drinkable Cask) 
| e = Error: Item not found Whisky (Drinkable Cask)
| f = Error: Item not found Whisky (Drinkable Cask)
| g = Error: Item not found Whisky (Drinkable Cask)
| h = Error: Item not found Whisky (Drinkable Cask)
| i = Error: Item not found Whisky (Drinkable Cask)
| j = Error: Item not found Whisky (Drinkable Cask)
| l = Error: Item not found Whisky (Drinkable Cask)
| m = Error: Item not found Whisky (Drinkable Cask)
| n = Error: Item not found Whisky (Drinkable Cask)
| o = Error: Item not found Whisky (Drinkable Cask)
| p = Error: Item not found Whisky (Drinkable Cask)
| q = Error: Item not found Whisky (Drinkable Cask)
| r = Error: Item not found Whisky (Drinkable Cask) 
| s = Error: Item not found Whisky (Drinkable Cask)
| t = Error: Item not found Whisky (Drinkable Cask) 
| u = Error: Item not found Whisky (Drinkable Cask) 
| v = Whisky (Drinkable Cask)

Note

An old version of this template was partially implemented at one time, attempting to redirect users to recipe pages as found in Category:Recipes. However only a small fraction of these individual recipe pages were ever created, and that project was abandoned.
The above text is transcluded from Template:Recipe/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:Recipe/doc. (View all subpages of this page.)