Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Ingredient: Difference between revisions

Template page
(nolink implementation)
(I love ifs)
Line 1: Line 1:
{{#ifeq:{{{2|}}}|nolink|{{#if:{{{3|}}}|[[File:{{{3}}}]]|[[File:{{{1}}}.png]]}}{{{1}}}|{{#if:{{{3|}}}|[[File:{{{3}}}|link=#{{{1}}}]]|[[File:{{{1}}}.png|link=#{{{1}}}]]}}[[#{{{1}}}|{{{1}}}]]}}<noinclude>
{{#if:{{{2|}}}|{{#ifeq:{{{2|}}}|nolink|[[File:{{{1}}}.png]]{{{1}}}|{{#ifeq:{{{3|}}}|nolink|[[File:{{{2}}}]]{{{1}}}|[[File:{{{2}}}|link=#{{{1}}}]][[#{{{1}}}|{{{1}}}]]}}|[[File:{{{1}}}.png|link=#{{{1}}}]][[#{{{1}}}|{{{1}}}]]}}|[[File:{{{1}}}.png|link=#{{{1}}}]][[#{{{1}}}|{{{1}}}]]}}<noinclude>
== How to use ==
== How to use ==
Meant to be used alongside the [[Template:CookingRecipe]] template. This is purely to quickly create a link to an anchor and have pretty picture.
Meant to be used alongside the [[Template:CookingRecipe]] template. This is purely to quickly create a link to an anchor and have pretty picture.


<pre>
<pre>
<nowiki>{{Ingredient|Dough|image.png|nolink}}</nowiki>
<nowiki>{{Ingredient|name|(image or nolink)|(nolink only if image)}}</nowiki>
</pre>
</pre>
== Meaning ==
Self explanatory, with some special arguments.
* '''name''': The name of the ingredient.
* '''image''': Optional. The image you want to use, will use the name if not specified. Requires a file extension.
* '''nolink''': Removes the automatic link to anchor with same name.


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 18:39, 25 October 2023

[[File:{{{1}}}.png|link=#{{{1}}}]][[#{{{1}}}|{{{1}}}]]

How to use

Meant to be used alongside the Template:CookingRecipe template. This is purely to quickly create a link to an anchor and have pretty picture.

{{Ingredient|name|(image or nolink)|(nolink only if image)}}

Meaning

Self explanatory, with some special arguments.

  • name: The name of the ingredient.
  • image: Optional. The image you want to use, will use the name if not specified. Requires a file extension.
  • nolink: Removes the automatic link to anchor with same name.