Board Thread:Support Requests - Getting Technical/@comment-653063-20150225004515

I do apologize for posting so much in the last couple of days... but I wasn't kidding about having solved all the easy problems myself, and being in too-deep waters now.

So... here is a template: http://disgaea.wikia.com/wiki/Template:DisgaeaMonsterAbilityChart (hereafter 'DMAC') Here is an example of the template in-use: http://disgaea.wikia.com/wiki/Faery (the 'Skills' chart) I did not design this template (I am not that wikicode-table-smart). But it's a really neat template.

If you view the source of the DMAC, look at the part where the cells that use the 'effect_code' data... see how for every row, alllllllllllllllll those options are repeated (so there's 4 rows, which means it's repeated 4 times)? Is there a way to get the same end result, but each 'effect_code' goes and looks for a single list of 'effect options'? So, for example, if I wanted to change one thing about one line, I can edit that one line once, instead of four times?

Can I shove it in a template? Can a template call another template? (Googling says yes, template can call template, but I can't figure out how.)

I googled for variations on the phrase "wikia.com #switch call template" and got nothing related to this. ("site:community.wikia.com #switch large quantity repeated data")

On the surface, this sounds like it's doing what I want: http://community.wikia.com/wiki/Thread:778151 - "Need help with #switch #if for getting information from other templates" - except I don't understand enough what's going on... One of the pages there has #explode, which I googled and got to http://www.mediawiki.org/wiki/Extension:StringFunctions#.23explode - but it says "The #explode function splits the given string into pieces and then returns one of the pieces", and that's... I'm pretty sure that's not what I'm looking for.

So I tried to shove it in a template anyway. Relevant links: http://disgaea.wikia.com/wiki/User:SannaSK/Sandbox (the relevant chart is the 'Golem' one at the very top; if 'effects' column doesn't say 'ATK', it's still broken.) http://disgaea.wikia.com/wiki/User:SannaSK/Template:Test (this holds the 'processing' part, that I copied out of the DMAC) http://disgaea.wikia.com/wiki/User:SannaSK/Template:Test2 (this holds the 'data' part, copied out of the DMAC)

I think this is the relevant line in Template:Test.

So yeah, it doesn't work.

Ok... I'm looking at the Gerontology pages again. If, on http://gerontology.wikia.com/wiki/User:AMK152/test3, the cell says "|status=deceased-verified", the string 'deceased-verified' turns into the variable that gets used to call the template "template:deceased-verified". Then, somehow, the code uses ((name)) -- well I guess it's here -- to query through "template:deceased-verified", and #explode takes the whole line of data and... passes it back to http://gerontology.wikia.com/wiki/Template:Infobox_person?action=edit, which is using the numbers... ok, I only halfway get what's going on there, but that makes a bit more sense. Still gonna guess it (especially the #explode) is not what I'm going to need, since I only need to search-for-and-return one line, which will hold one thing to be printed on the page.

So I need to... correctly call ... and then use to... nope, I'm sorry... I just don't know. I get that I'll need to stack them somehow, one inside the double-curlys of the other, but I just don't understand. I don't even know what I need to search for and read about to understand. I've read this http://community.wikia.com/wiki/Help:Template_parameters and some other pages I already closed...

Other than the already obvious reasons of "why have code repeated 4 times," and "why have a ton of code repeated 4 times," I want this to work because there's about... maybe even another fifty lines I need to put into 'test2' (obvs it will be called something 'more-betterer' when it goes live), plus I either need to see if I can use this same template(s) for the Humanoid classes (but probably they'll get their own copy, I'm assuming for layout reasons).

I mean, all things considered, if it works fine to do it this way, can all the 'data' just be somewhere else in the main template? But in ONE place, ONE copy? Not four?

Is this even the best way to do this? I feel like everything I do with #switch and #if is either clunky, or unnecessarily server-heavy, or just 'wrong' somehow. I just... there has to be a way to have one copy of the options, and any 'effect' goes looking there. But I can't figure out how to do it. (Hopefully this massive wall of text will be of use to someone later, as well.)

Thank you for your help. 