This Forum has been archived

Visit the new Forums
IndexTech notes → Tech note: Use TitleSort template for proper alphabetisation
Spoilers aren't cool here.
(Try The Howling, instead.)
Technical Advisory

Story titles which begin with the articles, a, an or the, are in the process of being stamped with the template, {{TitleSort}}. This new template will add a DEFAULTSORT line that automatically sorts the title by the first word that appears after the article. This template is harmless to pages that don't begin with an article, so it's being placed onto every title page. The main concern at this juncture is story pages, but if you know of other pages that begin with an article, feel free to place the template manually.

Case in point

By way of example, imagine that the page in question is The Mind's Eye. If you don't add this template, it will automatically sort in categories by the letter T. This isn't helpful. With {{TitleSort}} in place, it will sort by the key "Mind's Eye" — meaning that it will alphebetise under M.

Manual use

As new story pages are begun, please remember to use this helpful and easy template by slipping {{TitleSort}} onto the page. There is no need to define any variables with the template: just add {{TitleSort}}.

Be aware that if you're placing this template manually on a page that already has a DEFAULTSORT command, it will produce a rather ugly error message that basically says, "You idiot, there's already a DEFAULTSORT key here."

Known issue with bot placement

Pages that already have a DEFAULTSORT in place will be skipped by the bot during this initial round of use. However, because of the need to make an exception for pages that already have DEFAULTSORT in place, the bot won't be able to also make an exception for pages with {{TitleSort}} already on. Due to the fact that titles are often in several different categories, some pages are going to be stamped several different times with {{TitleSort}}. I could apply things with a great deal more care, making separate, manually-controlled runs of the bot. But I'm just not going to. Though slightly ugly at the bottom of the page, it has no effect on the way the page will look to the average user. The system will not object to having several different instances of the same sort key, which is what will obtain with multiple instances of {{TitleSort}}. The problem comes when a previously-existing DEFAULTSORT command makes the sort key, "Mind's Eye, The" and {{TitleSort}} makes it "Mind's Eye". A single page cannot have two different default sort keys, but it can have the same sort key defined as many times as the user wants. Hence, I'm just defining that the bot run in all the subcategories of category:stories — however many instances of {{TitleSort}} that might put on individual pages.


If you have any questions about the use of this template, or if you notice any problems with it, please contact me directly.


Community content is available under CC-BY-SA unless otherwise noted.