Forum:Category and sorting Templates

OK, I wanted to make a template to ease the creation of categories, or rather listing categories on various pages (especially if they are numerous categories), and how they will be organized/sorted on their perspective pages, the code I created is as such... Here in, lies my problem, silly, silly me I realized maybe I should also use the Default sort code key, maybe I should leave well enough alone and not necessarily deal with it and leave it as be, but I was trying to save some work at having to enter in multiple instances (for multiple categories) someone having to write out Ballard, Paul to sort out a page named Paul Ballard in multiple categories as such. Maybe I am making things to complicated here, I don't know, or perhaps there's a solution where someone did something similar, I am simply thinking on ease of use (but then again, perhaps I don't need so many templates for the sort keys) to help maintain a sense of consistency, especially in instances where multiple categories may be used. Does this make sense at all? Like...where did I go wrong, or should I not even bother?--Terran Officer 08:10, May 22, 2010 (UTC)


 * I hate to kind of bump in this sort of thing, but I think what I mean to ask is, is there a way to code it so that the category template would work as the above example is coded, wherein it can be overridden if I use the default sort sort key? Or should I simply take out the sort key section within the code and always use the default sort sort key? What I was trying to do was set up an ease of use system that would allow users to simply use a category template and add in a sort key if only one or to were in use, or to use default sort if multiple templates were in use. I suppose I could recode it so the default sort parameter is always used (albeit separately), but I had wanted to see if anyone else had done something similar to this and what they had done.--Terran Officer 06:55, May 24, 2010 (UTC)


 * I'm not sure what you want here. Do you want a template that will use &#123;&#123;PAGENAME&#125;&#125; as the sort key unless you specify a &#123;&#123;DEFAULTSORT:&#125;&#125;? You could do this if you reliably used a template to setup your categories, otherwise I think it would take Javascript to detect the use of &#123;&#123;DEFAULTSORT:&#125;&#125;. The template can't know whether you're using &#123;&#123;DEFAULTSORT:&#125;&#125; since it is out of its scope, unless you set it in the template itself. -- Fandyllic  (talk &middot; contr) 1:15 PM PST 27 May 2010