I've just created another infobox. A part of the code looks like this:
{{#if:{{{list|}}}|<ul>}} {{#if:{{{air|}}}|<li>[[{{{air}}} (Air)|Air]]</li>}} {{#if:{{{water|}}}|<li>[[{{{water}}} (Water)|Water]]</li>}} {{#if:{{{fire|}}}|<li>[[{{{fire}}} (Fire)|Fire]]</li>}} {{#if:{{{earth|}}}|<li>[[{{{earth}}} (Earth)|Earth]]</li>}} {{#if:{{{list|}}}|</ul>}}
It means if there is a variant, it would link to another page. Code in article:
|list = yes // parameter can be anything, just to make the <ul> tag appear. |air = Goblin |water = Pegasus |fire = N/A |earth = Nymph
What I was hoping for is to somewhat make the code simple, and less redundant, like this:
|list = Goblin, Pegasus, N/A, Nymph
N/A means the article does not exist and there is no link. Now, I have seen some templates that use a style like this. I just never understood what and how.