This Forum has been archived

Visit the new Forums
Forums: Index Support Requests Infobox Assistance
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 2204 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

We're trying to update the infoboxes on the Magi-Nation Wiki, but we could use some help regarding how to make certain sections within the infobox not appear if they irrelevant to the article.

The progress of our infoboxes can be found here (everything from that point on the page to the bottom). At this point, we've managed to construct the infoboxes so that the subsections within each area (Species, Moonland, First Appearance etc...) do not appear on the infobox if nothing is added to the section. However, we also want it so that the major sections within the infoboxes (Dream Creature Information, TCG Information, TV Series Information and Other Appearances) do not appear on the infobox without input either (so for instance, if nothing is added to a subsection under a section within the infobox, that entire section should not appear).

To give an example, if nothing was added to any of the sections under TV Series information or anything else regarding TV Series Information, then TV Series Information shouldn't show up on the infobox in the first place. Is that sort of CSS editing possible to manage? As it stands, we could use a little assistance. Also, for reference, this is my talk page on the Wiki, for reference. And here's the talk page for the wiki's chief admin.

Vellup 21:11, May 13, 2012 (UTC)

You can use #if parser function to make appear something only when they are needed. Just wrap the element you want to switch like {{#if:{{{Parameter|}}}|Content}} (if Parameter has a value, Content will appear). So the specified format would be like next:
{{#if:{{{First Appearance|}}}|<tr><th>Spicies</th><td>{{{First Appearance}}}</td></tr>}}
And to avoid repetition of this code, you'd better to make first a sub-template out of this, and transclude it to your infobox.

sub-template (template:infobox row)


and apply it to your infobox

{{Infobox Row|Spicies|{{{Spicies|}}}}}
{{Infobox Row|Moonland|{{{Moonland|}}}}}
There's some other solutions also. I wouldn't say this is the best.  Cafeinlove msg 2012-05-14, 8:38 am(UTC+9)