Forum:Same data used at many pages via different template calls

I do not presume that templates are the only or best solution for what I have in mind.


 * Problem Statement: At a game wiki site information describing 120-150 skills must be organized as records of some from or another. Currently they exist as parameter value pairs in template calls. Each of these "records" is comprised of 30 pieces of data per skill. The data types are all strings of course but represent numbers and uploaded images as well as descriptive text. A unique selection of 20-25 of these skills is associated with each of 30 characters and an article exists for each character to describe their unique set of skills.
 * At least three different templates are used to present different and overlapping subsets of data from each record. As the wiki is new there are gaps in the data and so it is vital to plan for easy and error-free updates and corrections
 * It would be preferable to manage these data revisions at one page for each skill.

OK that's about as concise as I can manage at this late hour! I am new to wikis and don't want to reinvent the wheel here.
 * Is there a best practice for such a situation?

While updating the various template calls the thought occurred to me that each set of |param1 = value1 : records might be stored on one Template:skillname### page for each of the 120-150 skills. After reading this Advanced templates help topic my hopes were raised. I rather naively thought that I could use an embedded template call within each of the three "outer" templates as follows: (spaces added for forum readability only) This did not yield the desired result despite my efforts to escape the pipe character using  |  and  &amp;#124;  within Template:skillname###
 * param2 = value2
 * paramN = valueN
 *  
 *  
 *  

My goal here was something very similar to an associative array which any awk/gawk/perl programmer would be familiar with. Indexing each piece of data by name is preferable to indexing by number for maintainability reasons especially because we want non-technical readers of our game wiki to easily contribute missing pieces of data or correct erroneous data.

What I have unsuccessfully tried to do with this use of Template:skillname### is the C programming equivalent of an #include file insertion.


 * 1) Should I persevere with templates or is there a better approach?
 * If the template path is the way to go then :
 * 1) Are there other special characters I need to be escaping?
 * 2) Are there other subjects akin to substitution that I need to study?

You're attacking the problem from the wrong end. Instead of trying to extract the parameters, you should inject the template. The content page sends the presentation template it want into the data template, which in turn sends its parameters into the presentation template given.


 * Content pages
 * :Someskill -  
 * :List_of_skills -  


 * Skill data
 * Template:Skilldata/Someskill -  
 * Template:Skilldata/Otherskill -  </tt>


 * Skill presentation
 * Template:SkillPage -  This page is about, a skill available to . </tt>
 * Template:SkillListItem -  * ( </tt>

The above is just one of many ways to use the pattern. Subpages for the data is not necessary, they can be primary templates. They can also be located in another namespace, e.g. as subpage of the main content page. With DPL, you can have the main content page also be the data page, and use template substitution in DPL queries to reuse the data with other templates. The sky (and about 2 MB in template inclusions) is the limit. - Dashiva (talk) 16:24, 27 May 2008 (UTC)


 * It looks to me as if this is being overcomplecated. From what I can see just getting an overview of what was said here, this is something you should be using Semantic MediaWiki for. Organizing data spread out over multiple pages, and creating lists and compilations of various portions of that data is what SMW is all about. Wikia does have SMW ready to be enabled on any wiki that asks for it. ~ NOTASTAFF Daniel Friesen (DanTMan, Nadir Seen Fire) (talk) (tricks) (current topic) May 27, 2008 @ 17:23 (UTC)