Board Thread:Support Requests - Getting Technical/@comment-3542404-20140803095243

Hi guys, I want to rig this template with a function so that a specific category is assigned depending on two values.

I'll explain from the top: characters can be assigned several different classes (sniper, heavy weapons, support etc) which are given a category using a switch template. This works great, but there is one specific class, "MEC Trooper" which has several sub-types or "specializations". I'd also like to use a switch template to assign categories for the different sub-types it would only run if class=MEC Trooper.

So it would look a bit like this:
 * class=Sniper
 * specializations=

Outcome: Category:Sniper


 * class=Sniper
 * specializations=Psionic

Outcome: Category:Sniper, Category:Psionic (Anything other than MECs can be assigned this specialization, but it's checked over by admins to ensure people stick to that rule)


 * class=MEC Trooper
 * specializations=Support

Outcome: Category:MEC Trooper, Category:Support (MEC)

My plan would have been to use a switch function, but I don't know how to get it to be dependent on two variables. Being used to Excel I would have used a combination of AND and IF to run it, but I can't find an equivalent for AND so help would be very much appreciated.

Many thanks! 