I'm trying to create a mediawiki template:
|-
| {{{name}}}{{#if:{{{ref|}}}|<ref>{{{ref}}}</ref>|}}{{#if:{{{ndb|}}}|<ref>https://ndb.nal.usda.gov/ndb/foods/show/{{{ndb}}}</ref>|}} || {{{size|--}}} || {{{carbs|--}}} || {{{sugar|--}}} || {{{fiber|--}}} || {{{fat|--}}} || {{{protein|--}}}
Most of it works OK but if I pass a ref
or a ndb
parameter, the #if
doesn't work properly I get
<ref>{{{ref}}}</ref>
or
<ref>https://ndb.nal.usda.gov/ndb/foods/show/{{{ndb}}}</ref>
I don't get what I would expect:
<ref>http://the.passed.value/</ref>
or
<ref>https://ndb.nal.usda.gov/ndb/foods/show/passed_value</ref>