Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

Template talk:Userbox Level 50

From Paragon Wiki Archive
Revision as of 16:24, 5 June 2008 by Archabaddon (Talk | contribs)

Jump to: navigation, search

I give up! I can't figure out how to make the switches work :( Any guidance would be appreciated. Archabaddon 23:16, 4 June 2008 (UTC)

You were really close. If you check the revision history you'll be able to see what I did to tweak it. A couple of tips for reference (I've learned 'em all the hard way. :)):
  • The "lc" in the switch forces lowercase on the switch value passed in the template call. So, so if pass in "Villains" in the template call, the switch will change that to "villains". If you use the "lc" and any of your case values have capital letters (i.e. "Villains" as opposed to "villains"), nothing will ever match it. (You don't have to use the "lc", by the way.)
  • Each case value (at least from my experience) is exact, so if your case shows "<h>", then "<h>" would have to be passed to hit that case rather than "h".
  • Even if you include documentation with an example template call that's using any sort of logic, there's no real way to see how it's going to look when you actually try to use it until you save the template. (Which can be a little annoying to say the least.)
All in all, you didn't do too badly. I usually fill the Recent Changes history with about 20 or 30 entries when I'm trying to hack my way through a template. --Eabrace 04:22, 5 June 2008 (UTC)
Thanks for all of your excellent pointers! I couldn't find any online references for how to program wiki switch functions, so I was at a loss. Now I've also added an option for "both heroes and villains" as well as usage (borrwed from the Veteran Userbox). Once again I'm in your debt :) Archabaddon 16:24, 5 June 2008 (UTC)