Template talk:Userbox Level 50: Difference between revisions

From Homecoming Wiki
Jump to navigation Jump to search
imported>Archabaddon (historical)
(Help!)
 
imported>Eabrace (historical)
mNo edit summary
Line 1: Line 1:
I give up!  I can't figure out how to make the switches work :(  Any guidance would be appreciated. [[User:Archabaddon|Archabaddon]] 23:16, 4 June 2008 (UTC)
I give up!  I can't figure out how to make the switches work :(  Any guidance would be appreciated. [[User:Archabaddon|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 to 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. --[[User:Eabrace|Eabrace]] 04:22, 5 June 2008 (UTC)

Revision as of 04:22, 5 June 2008

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 to 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)