Wikia

Community Central

WatchlistRandom pageRecent changes

Template Code - Confused

63,506pages on
this wiki

Forum page

Forums: Index Support Requests Template Code - Confused
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 469 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

Hi, I have created a template for the wiki I have created here which uses the Infobox Template as a starting point.

I am a little confused as to how to make it hide the fields that aren't entered though, I have tried using the templates and tutorials provided but am still struggling, essentially I want to hide release dates for countries that don't have a release date filled in.

Any help would be greatly appreciated PrivateSniper 12:07, February 9, 2011 (UTC)

The best way to do it would be adding #if parser functions to the template's parameters. But I think you'd be better off by just using the original infobox template instead of this 'template within a template' - empty parameters will not show by dafualt since the original template is already using #if functions. Sovq 12:21, February 9, 2011 (UTC)
Yes I want to use if's on this template, but I am unsure of the exact code I should be putting in to make it work PrivateSniper 12:47, February 9, 2011 (UTC)
The link Sovq provided would help you, but it's simple enough to explain here: {{#if: condition | content if true | content if false}}.  Monchoman45  Talk  Contribs  Skystone  12:57,2/9/2011 


I tried to make an example of how the coding should be done, but have realized that the default infobox template does not show further results if one 'earlier' parameters is not defined. So in that case, if you don't use a 'Row 3 title' parameter, which means won't add the 'NA' title, none of the other release dates will show. That's a poor solution IMO and in that case I suggest rewriting the whole template without using the default infobox template. I can do that for you if you want.
On a side note; am I interpreting something wrong or has the default infobox template always been 'cutting off' latter parameters if former ones weren't defined? I.e. if you don't define 'Row 2 title' than none of the other parametrs will be shown, even if defined? If so; that's a flaw Sovq 13:03, February 9, 2011 (UTC)
Yes I gave it a go myself using the infobox template but as you say it requires the fields before to make the fields later work, if you wouldn't mind rewriting a template for this that would be fantastic :) PrivateSniper 13:09, February 9, 2011 (UTC)

Latest Photos

Add a Photo
7,469photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki