Difference between revisions of "Template talk:RecipeRow/NoBuffsHealthEnergy"
Margotbean (talk | contribs) |
|||
Line 22: | Line 22: | ||
|{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}} | |{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}} | ||
|[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6 | |[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
</pre> | </pre> | ||
Line 43: | Line 37: | ||
|{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}} | |{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}} | ||
|[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6 | |[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
Line 56: | Line 44: | ||
{{Recipes|header|hide=buff,duration,restores|crafting=true}} | {{Recipes|header|hide=buff,duration,restores|crafting=true}} | ||
{{:Warp Totem: Beach|RecipeRow/NoBuffsHealthEnergy}} | {{:Warp Totem: Beach|RecipeRow/NoBuffsHealthEnergy}} | ||
− | |||
{{Recipes|footer}} | {{Recipes|footer}} | ||
</pre> | </pre> | ||
+ | |||
+ | {{Recipes|header|hide=buff,duration,restores|crafting=true}} | ||
+ | {{:Warp Totem: Beach|RecipeRow/NoBuffsHealthEnergy}} | ||
+ | {{Recipes|footer}} | ||
===Discussion=== | ===Discussion=== | ||
Line 64: | Line 55: | ||
I believe this template works really well, because the code is clean and tidy. What's more, it frees us from repetitive work. If another update comes and some recipes are changed, what we need to do will only be editing the main page of the changed item, instead of copying the work to every ingredient. | I believe this template works really well, because the code is clean and tidy. What's more, it frees us from repetitive work. If another update comes and some recipes are changed, what we need to do will only be editing the main page of the changed item, instead of copying the work to every ingredient. | ||
− | However, since this page is designed for cooking recipes initially, | + | However, since this page is designed for cooking recipes initially, some errors will take place if the infobox is not compatible. For example, It is not considered the case that the items cannot be sold. |
My suggestion: A switch function could be added to check whether the item is priceless in [[Template:Infobox cooking]] and [[Template:RecipeRow/NoBuffsHealthEnergy]]. See the "default sellprice" in [[Template:Infobox]]: | My suggestion: A switch function could be added to check whether the item is priceless in [[Template:Infobox cooking]] and [[Template:RecipeRow/NoBuffsHealthEnergy]]. See the "default sellprice" in [[Template:Infobox]]: | ||
Line 79: | Line 70: | ||
</pre> | </pre> | ||
− | Unfortunately, I haven't used this programming language in wiki before, so I'm afraid coding is difficult for me. Maybe some excellent programmers could help? Thank you very much :) [[User:群星之尘|群星之尘]] ([[User talk:群星之尘|talk]]) | + | Unfortunately, I haven't used this programming language in wiki before, so I'm afraid coding is difficult for me. Maybe some excellent programmers could help? Thank you very much :) [[User:群星之尘|群星之尘]] ([[User talk:群星之尘|talk]]) 08:14, 6 May 2024 (UTC) |
Latest revision as of 08:14, 6 May 2024
Showing crafting recipes
I found this template can be used to display crafting recipes conveniently while updating them, but a problem occurs while showing selling prices.
- I'd better to discuss about this before changing the template :)
Comparison
Coral is no longer used to craft Deluxe Speed-Gro in v1.6, so let's use Coral as an example. I'm sorry for that, but for a better explanation of the problem, I deleted the line "sellprice = Cannot be sold" in the page Bait Maker. You could revoke that change if it is necessary.
The old code
{|class="wikitable sortable roundedborder" !Image !Name !Description !Ingredients !Recipe Source |- |[[File:Warp Totem Beach.png|center]] |[[Warp Totem: Beach]] |{{Description|Warp Totem: Beach}} |{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}} |[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6 |}
Image | Name | Description | Ingredients | Recipe Source |
---|---|---|---|---|
Warp Totem: Beach | Warp directly to the beach. Consumed on use. | Hardwood (1) Coral (2) Fiber (10) | Foraging Level 6 |
The new code
{{Recipes|header|hide=buff,duration,restores|crafting=true}} {{:Warp Totem: Beach|RecipeRow/NoBuffsHealthEnergy}} {{Recipes|footer}}
Image | Name | Description | Ingredients | Recipe Source(s) | Sell Price |
---|---|---|---|---|---|
Warp Totem: Beach | Warp directly to the beach. Consumed on use. | Hardwood (1) Coral (2) Fiber (10) | Foraging Level 6 | 20g |
Discussion
I believe this template works really well, because the code is clean and tidy. What's more, it frees us from repetitive work. If another update comes and some recipes are changed, what we need to do will only be editing the main page of the changed item, instead of copying the work to every ingredient.
However, since this page is designed for cooking recipes initially, some errors will take place if the infobox is not compatible. For example, It is not considered the case that the items cannot be sold.
My suggestion: A switch function could be added to check whether the item is priceless in Template:Infobox cooking and Template:RecipeRow/NoBuffsHealthEnergy. See the "default sellprice" in Template:Infobox:
<td id="infoboxdetail">{{#switch:{{lc:{{{sellprice|}}}}} |n/a|unverkäuflich|n/d|no puede venderse|cannot be sold|''cannot be sold''|ne peut être vendu|non può essere venduto|なし|売却不可|해당 없음|판매 불가|nem lehet eladni|não pode ser vendido|н/д|нельзя продать|satılamaz|不适用|不能出售|不可出售 = ''Cannot be sold'' |#default = {{#switch:{{lc:{{{quality|all}}}}} |false|normal = {{#iferror: {{Price|{{{sellprice|}}}}} | {{{sellprice|}}} | {{Price|{{{sellprice|}}}}} }} |#default = {{Qualityprice|{{{eng|Blank icon}}}|{{{sellprice|0}}}|dsv=false}} }} }} </td>
Unfortunately, I haven't used this programming language in wiki before, so I'm afraid coding is difficult for me. Maybe some excellent programmers could help? Thank you very much :) 群星之尘 (talk) 08:14, 6 May 2024 (UTC)