Forum:Sorting template

Hello, I created this template to controlling the sorting of progressive files and pages in a category, especially to avoid that "Page 10" will be sorted before "Page 2". I used the DEFAULTSORT magic word, but I cannot understand why it's not working properly since if you try to see what sorting keys is used, there shouldn't be any problem.


 * I see two problems with it.


 * The first part is that you apply the template to files, more specifically because the pagename of these files has an extension. The template takes the second piece of the pagename, and pads it to a maximum length of 4 digits. So a "2" becomes "0002", a "23" becomes a "0023" etc. With the files however, the second piece of the pagename looks like "2.jpg" and "23.jpg". That's longer than 4 digits already, so it doesn't pad it.


 * The second problem has to do with the caching of categories... It seems that the last page you edit is affecting the order of sorting. So the category gets messed up no matter what you do.


 * -- 19:01, August 4, 2012 (UTC)