User talk:Vapor/sandbox/sandbox3: Difference between revisions

From The Urban Dead Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
Line 15: Line 15:
-[[MHS|<span style="color: Black">'''MHS'''</span>]][[User_Talk:MHSstaff|<span style="color: DarkBlue">'''staff'''</span>]] 01:30, 10 January 2011 (UTC)
-[[MHS|<span style="color: Black">'''MHS'''</span>]][[User_Talk:MHSstaff|<span style="color: DarkBlue">'''staff'''</span>]] 01:30, 10 January 2011 (UTC)
:Yeah, but I think the idea is to have one template that does all the work. I think I've figured it out but I need to get to a computer to do it (I'm on my B&N Nook right now) {{User:Vapor/sig}} 01:54, 10 January 2011 (UTC)
:Yeah, but I think the idea is to have one template that does all the work. I think I've figured it out but I need to get to a computer to do it (I'm on my B&N Nook right now) {{User:Vapor/sig}} 01:54, 10 January 2011 (UTC)
::That's what this does. It is a driver template that depending on if the user puts in a RE,PM,or nothing, well, it calls the right template to use. Splitting it up into separate parts makes it easier to debug. But if you have one that is already working, use that! -[[MHS|<span style="color: Black">'''MHS'''</span>]][[User_Talk:MHSstaff|<span style="color: DarkBlue">'''staff'''</span>]] 02:00, 10 January 2011 (UTC)

Latest revision as of 02:00, 10 January 2011

You can try something like this:

{{switch|{{{PAGEIN}}}
|case: PM= {{User:MHSstaff/Projects/TestingGrounds1|{{{USERIN}}}}}
|case: RE= {{User:MHSstaff/Projects/TestingGrounds3|{{{USERIN}}}}}
|default= {{User:MHSstaff/Projects/TestingGrounds2|USERIN2={{{USERIN}}}}}
}}


where TestingGrounds1 is a PM template, TestingGrounds3 is a RE template, USERIN is the user you want info for, and TestingGrounds2 uses the pagename to determine the right one to use. In my case, it will checks to see if it is in my Project space or Image space to call one of TestingGrounds1 or 3.

User talk:MHSstaff has examples for the first two cases, where you pick PM or RE.
User:MHSstaff/Images has the pagename one.

-MHSstaff 01:30, 10 January 2011 (UTC)

Yeah, but I think the idea is to have one template that does all the work. I think I've figured it out but I need to get to a computer to do it (I'm on my B&N Nook right now) ~Vsig.png 01:54, 10 January 2011 (UTC)
That's what this does. It is a driver template that depending on if the user puts in a RE,PM,or nothing, well, it calls the right template to use. Splitting it up into separate parts makes it easier to debug. But if you have one that is already working, use that! -MHSstaff 02:00, 10 January 2011 (UTC)