Forum:Using switch function, together with if function?

Greetings, I have something of a long winded explaination, and question, so I hope that you (the reader), can bear with me, I'll try to be as simplistic, and to the point as I possibly can, and If this has been answered elsewhere, I apologize. I wasn't really sure on how to search around for this particular topic/question at hand. Moving on...

I am an editor for the wiki of the Canadian television series, Trailer Park Boys, where the episode titles can get somewhat long winded, and extensive. As such, I naturally made some templates to help users get the proper format, punctuation, etc... to get to the right page title without having to make a ton of redirects. I have come to decide that some things need an adjustment, as the episode titles displaying in the content pages can make things even worst, especially if theres several to list... Where I start running into a problem is, that I could achive my desired effects, that is, do what I want, were I to spread the code across several templates. Here's the kicker, I am aware that wiki text/code/markup is capable of doing so much more then I am actually aware of, understand, or take advantage of. Therefore, I was wondering if it were at all possible to do what I want within one template.

What I want it to appear as, more or less, is to have the wiki text/mark up appear like so: S1E01 . Seems reasonable enough, and I have actually achived this, except that in using the "#switch:" parameter, I can only seem to do this in one instnace.  And in a situation, where I may need to display something like "TPB: S1E01, S2E03, S5E07"  I think what I am trying to do may be reminencent to this, but I am not entirely sure (I certianly am not looking for the categories to switch, and a single event, etc...)

Here's my code...

TPB:

So really, I need to be able to display multiple parameters in one instance of template use, if I possibly could... I tried to do some testing, and research, but I've fallen short. Any help is appreciated. --Terran Officer 03:04, October 24, 2011 (UTC)


 * I think for that to work you will need multiple switch functions within the same template. For example:

TPB:
 * As you can see, in the code above there are three switch functions, each handling what will display for separate parameters. The downside of that method is that you will need enough switch functions in the template to allow for listing every possible episode. Depending on how many episode there are in your show, the template could end up containing upwards of 20 switch functions and would become rather dificult to maintain. If you want to simplify template maintenance, you can use subtemplates (templates within templates), like so:
 * A possible subtemplate, named Ep, containing the switch function:


 * The main template which uses Ep:

TPB:
 * --Gardimuer { ʈalk } 05:37, October 24, 2011 (UTC)