User talk:Aichon: Difference between revisions

From The Urban Dead Wiki
Jump to navigationJump to search
Line 209: Line 209:


I want to do this again but without spamming up my namespace with templates. Would there be a way to have all of the statuses on one page in one code and have the specific ones only appear if I use the same variables eg "online" "offline" "idle" etc? I've had a look at if and switch templates and it's a whole new ballpark for me that I've never explored till now, any quick tips? --{{User:DanceDanceRevolution/sig3}} 16:41, 20 July 2010 (BST)
I want to do this again but without spamming up my namespace with templates. Would there be a way to have all of the statuses on one page in one code and have the specific ones only appear if I use the same variables eg "online" "offline" "idle" etc? I've had a look at if and switch templates and it's a whole new ballpark for me that I've never explored till now, any quick tips? --{{User:DanceDanceRevolution/sig3}} 16:41, 20 July 2010 (BST)
:So, to make sure I'm clear on this, you have a single page in your namespace which will have the keyword on it, and that word is the variable you are using to reflect your status? And then, you want to include that page in a switch statement which will then select from among various signatures based on that status word? If so, then yes, it should be possible, though I'm not sure that I would advise it.
:In terms of why I'd advise against it, as you know, templates on pages break when the page gets too large. Since you'd effectively be having the code for, say, 6-10 signatures in a single template call, that would mean that even if you're only using one of them at a time, you'd still be having all of that other unused code counting against the size of the page (this is a bit of an oversimplification of the problem, but it gets the gist across; if you want more details, let me know), which would make the pages you post on grow much more quickly than they would otherwise. If you kept the sigs small, it wouldn't be as big of an issue, but making them large would probably become problematic.
:If you want to go ahead with it, the code is relatively straightforward, I think. It'd be along these lines:
<pre>{{switch
|{{User:DanceDanceRevolution/status}}
|case: ooo=CODE_FOR_OUT_OF_ORDER_SIG_HERE
|case: online=CODE_FOR_ONLINE_SIG_HERE
|...
|default=CODE_FOR_PLAIN_SIG_HERE
}}</pre>
:Assuming that your User:DanceDanceRevolution/status page had the keyword on it, then that's the sort of thing you'd use to do it. And you'd obviously fill in some more signatures in that "..." area. You can see an example of me using a switch statement to do a countdown in my signature [http://wiki.urbandead.com/index.php?title=User:Aichon/Signature&action=edit&oldid=1717885 here] (ignore the messy switch statement at the end, since it was hackish), but that's quite a bit simpler than what you're trying to do. Anyway, let me know if that answers your questions or if I lost you on a point somewhere. I'll be happy to clarify as I can if you have any further questions. {{User:Aichon/Signature}} 20:43, 20 July 2010 (BST)


==must thanked and praised you==
==must thanked and praised you==
for the impressive shadow coloring for text in your signature. so, uh can i use it for my signature? :P :P :P --{{User:Evan_Arnoldi/sig}} 16:35, 20 July 2010 (BST)
for the impressive shadow coloring for text in your signature. so, uh can i use it for my signature? :P :P :P --{{User:Evan_Arnoldi/sig}} 16:35, 20 July 2010 (BST)
:It looks like you've already figured out how to use it, and yep, I definitely think it's fine to borrow stuff from other people's code around here. :P You don't have to worry about crediting me for it either, since I actually borrowed the idea from Chief Seagull. {{User:Aichon/Signature}} 20:15, 20 July 2010 (BST)
:It looks like you've already figured out how to use it, and yep, I definitely think it's fine to borrow stuff from other people's code around here. :P You don't have to worry about crediting me for it either, since I actually borrowed the idea from Chief Seagull. {{User:Aichon/Signature}} 20:15, 20 July 2010 (BST)

Revision as of 19:43, 20 July 2010

Aichon:Talk
Aichon
ˈīˌkän :Talk