Forum:The "if" command

The #if: command. Is there anywhere I can find out how to use this? But if there isn't, I'll keep it short: So, I have a Talk template at a wiki, it involves me to type " ". I want to use the #if: command to add something else. So when I type " ", it will choose another template with the extra . So if I were to call the first template " " and the second "  " what would the code be (if it is possible) to choose the template based on if there's three "|"s --I Lion Heart I 19:16, 30 September 2008 (UTC)


 * See c:help:Help:Parser_functions and Forum:Template or Parser Function Expansion Problem.


 * Your third parameter will require at least one character (computing), and it probably needs to be a non-whitespace (computer science) character (i.e., not a spacebar or Enter character).


 * Place that anywhere (multiple places if necessary) in your code. If the third parameter was not passed, an empty value is used in its place. --Jesdisciple (talk) 20:30, 30 September 2008 (UTC)
 * Thanks. --I Lion Heart I 17:02, 1 October 2008 (UTC)

Need help
I'm trying to code something, yet it just won't work. Can someone look at the code here, see what I am trying to do, and tell me why it doesn't work/ if it can ever work. --I Lion Heart I</FONT> 19:56, 14 October 2008 (UTC)


 * I've copied the template over here in User:TulipVorlax/ILHI.


 * So you're trying to have a table with variable number of row with a variable number of columns ? — TulipVorlax 21:13, 14 October 2008 (UTC)
 * That is the gist of it. It's a template which could be used for anything. In actual fact it's for versions of games with more than one translations (going across the rows). And then columns for multiple related pages. I'm trying to code so only one template is used for all different games. --I </FONT>Lion Heart</FONT> I</FONT> 17:58, 15 October 2008 (UTC)
 * In this perticular case, maybe the HTML format of tables would work better. I'll try it if you want when i'll have more time... — TulipVorlax 18:08, 15 October 2008 (UTC)
 * Please. --I </FONT>Lion Heart</FONT> I</FONT> 18:14, 15 October 2008 (UTC)

With User:TulipVorlax/ILHI2 you can have 5 columns and 3 rows. First two columns allways show but only header if no value is specified for the rows. — TulipVorlax 06:16, 17 October 2008 (UTC)


 * Hum, it makes a weird effect now. Maybe you might be able to fix a thing. I'll lookit up too. — TulipVorlax 06:20, 17 October 2008 (UTC)


 * GOT IT ! Lol. Looking at the source of the page, there was

at many place in the tables. So i've placed the code on a single line. It's not as easy to work with it's internal code now but it render correctly.
 * By the way, i did not kept the same names as you for the parameters. I never begin parameter names with a number (not sure why). — TulipVorlax 06:37, 17 October 2008 (UTC)
 * You have my thanks. Cheers. :D --I </FONT>Lion Heart</FONT> I</FONT> 15:45, 17 October 2008 (UTC)
 * Hang-on; is there any additional code the wiki needs for it to work? The same thing happens as with my original failed version as with this. --I </FONT>Lion Heart</FONT> I</FONT> 16:08, 17 October 2008 (UTC)


 * Oh that i woudn't know. It's a standard thing, should work everywhere. Maybe the project you're working on has some problems. We might need staff help. — TulipVorlax 18:59, 17 October 2008 (UTC)


 * There are other ways to do this as well, more flexible (and legible) ones, but to decide what is best I need more information on how this is supposed to work and why you choose to use a template and not a wikitable. Do you have a link to an example table for me, or a page that already has the information that you want to have tabularized? --◄mendel► 10:58, 18 October 2008 (UTC)
 * this page uses the basic template I tried to expand from -- as this is the style table we use everywhere. Then one admin said "Wouldn't it be cool if we good get it to work like a template", and then I said, "This is possible using the "#if:" command", and then another admin said "Make a sandbox version so we can have one template for all games". And here I am. I </FONT>Lion Heart</FONT> I</FONT> 14:24, 18 October 2008 (UTC)


 * On the version i've done, you dont even have to enter n/a in empties cells and they will align properly anyway. — TulipVorlax 01:14, 19 October 2008 (UTC)


 * Ok, Lion Heart, thanks for the clarification. If I understand your needs correctly, what you want the template to do is to color the header white on blue and maybe set the table parameters. This seems to me to be most easily achieved with some CSS, you'd start the table  and put some code in MediaWiki:common.css (such as  ) and then you get the full flexibility and familiarity of regular wiki tables without the hassle of adding the formatting for the white on blue to every title item. Every template solution I could come up with is more complicated without any added gain. --◄mendel► 22:00, 22 October 2008 (UTC)