Help talk:Category

Revamping the category pages
I don't know the right place to mention this, but wikipedia's category pages could use an overhaul. Whenever I end up on a category page, I'm disappointed that I've arrived at a page that's hard to find information in. They are only sorted alphabetically and contain too little information per page. There should be ways to reorganize the listings (chronologically at least) and a way to search the lists. 71.7.174.105 (talk) 17:47, 19 June 2021 (UTC)
 * Category pages can only be organised in one way, it would require a fundamental software change (file a feature request at ) to do it another way. That has little change of being accepted, so you should consider using a list, see Categories, lists, and navigation templates. -- Red rose64 &#x1f339; (talk) 08:32, 20 June 2021 (UTC)
 * Suggest: Allowing for a short tag or description in a Category tag which is displayed alongside the sort key in the category page.
 * I agree that it is nearly impossible to get good information from a large category page when all you have is the page titles. For example, a list of magazines should have the publication dates in the list, genre and "magazine".  Suggest "Time (1922-present, magazine, USA)" where the category tag is "1922-present, magazine, USA" 107.197.56.204 (talk) 15:49, 20 December 2022 (UTC)

Wikilink to Template:DEFAULTSORT
I don't think that  is a useful addition here. DEFAULTSORT is a magic word, not a template. If you follow the link to Template:DEFAULTSORT, the first thing you see is a box telling you not to use the template. -- John of Reading (talk) 06:39, 7 September 2023 (UTC)


 * @John of Reading I think you are mistaken. I infer the box you are talking about is the following,
 * Said box is not "telling you not to use the template". It is actually giving you guidance about its use. Regards, Thinker78  (talk) 06:55, 7 September 2023 (UTC)
 * Just because something has braces, does not make it a template.
 * See also: mw:Help:Magic words. - jc37 08:14, 7 September 2023 (UTC)
 * Right,  is not a template call but a builtin MediaWiki feature and it seems confusing to link Template:DEFAULTSORT. We don't want the template to be used and it currently has zero uses. I have removed the link but changed   to   to show the colon right away. If you write   alone in wikitext (which would be pointless) then it actually calls the template and would produce a red template link if there was no template. The colon is needed to get the magic word. PrimeHunter (talk) 00:00, 8 September 2023 (UTC)
 * Well, if the guideline is telling people to use and guidance to such use is in the page TEMPLATE:DEFAULTSORT, I don't see how removing such link is helping. I mean there is some contradiction here going on. From the template's documentation, " is a magic word used to modify the sequence of pages shown on category pages." The page goes on to talk about the magic word and how to use the wikitext. It appears that it may not be a template but for convenience was placed in template namespace. Regards,  Thinker78  (talk) 04:04, 8 September 2023 (UTC)
 * Pinging (a template editor).  Thinker78  (talk) 04:06, 8 September 2023 (UTC)
 * Okay, I'm here, but I'm not sure what if anything I'm being asked to do. :-) Skimming the above, I agree that the  template is deprecated in favor of the   magicword, which looks similar to a template. But I'm not sure that my saying that is particularly helpful.  — SMcCandlish ☏ ¢ 😼  06:42, 8 September 2023 (UTC)
 * Okay, I'm here, but I'm not sure what if anything I'm being asked to do. :-) Skimming the above, I agree that the  template is deprecated in favor of the   magicword, which looks similar to a template. But I'm not sure that my saying that is particularly helpful.  — SMcCandlish ☏ ¢ 😼  06:42, 8 September 2023 (UTC)

TEMPLATE:DEFAULTSORT might be added to the See also list at Help:Category but your edit was confusing. It said: It is possible to set a default sort key which is different from  by using the magic word  : But is not the magic word, it's a template we don't want anyone to use. We only created that template to help users who accidentally write  instead of the correct. Without the template,  would make a red link to a non-existing template and no defaultsort would be applied to the page. It would be hard for many users to see why it went wrong. The example on the following correctly uses the magic word and not the template you want to link in the exact place we tell users to use the magic word. PrimeHunter (talk) 10:54, 8 September 2023 (UTC)


 * What about adding the wikilink to the text in this manner, ""? Regards, Thinker78  (talk) 03:44, 9 September 2023 (UTC)
 * Because that links to the template, which is precisely what we don't want. I have the link to take people to the most relevant section. -- Red rose64 &#x1f339; (talk) 15:03, 9 September 2023 (UTC)
 * Thanks for taking the time to refine the link Redrose64. I am still puzzled why the opposition to the DEFAULTSORT link in this thread though, as it gives guidance mostly about the magic word. Regards, Thinker78  (talk) 19:55, 9 September 2023 (UTC)
 * Linking to the magic word gives more information about the magic word, should someone want to know more about it. Linking to DEFAULTSORT, which also gives more information about the magic word (but importantly, is not the magic word that looks identical to it), is unnecessary because it requires an editor to go an extra click to get the same information and can potentially cause more confusion if they use the template and not the magic word. Primefac (talk) 20:04, 9 September 2023 (UTC)
 * have you looked at the source for that template? It uses the magic word and adds the page to Category:Pages which use a template in place of a magic word, a maintenance category for pages that mistype magic words as templates. The template has well-written documentation but is something designed to fix a typo, and so by linking to it, we could confuse a new editor into adding typos to the articles. Rjjiii (talk) 21:51, 9 September 2023 (UTC)
 * I don't know how we could confuse editors into typos by leading them to the specific DEFAULTSORT documentation because it precisely states how it should be used and emphasizes how not to use it. Sorry, I am confused. To me the opposed link has cleared confusion in the past. Therefore I am really lost into the rationale of the consensus in this thread. Maybe I am trying to see things from a perspective of someone who donn't know how to use DEFAULTSORT?
 * "Help:Magic words#Behavior switches" only provides a passing mention of DEFAULTSORT, with a one-line sentence.
 * I remember going to lengths trying to figure out what was a sort key. To me the DEFAULTSORT link seems so much more useful. I don't know what I am missing. Sorry. Regards, Thinker78  (talk) 23:33, 9 September 2023 (UTC)
 * Thinker78 (talk) 23:41, 9 September 2023 (UTC)
 * If I could take a step back - we're talking about, yes? Doesn't that section pretty much say what the template documentation says? If it doesn't, should we consider expanding that section? I think I can see where you're coming from but if we can improve the primary place someone would be looking for this information, that would probably the most helpful option. Primefac (talk) 06:06, 10 September 2023 (UTC)
 * "we're talking about Help:Category § Default sort key, yes?" Yes.
 * Doesn't that section pretty much say what the template documentation says? Pretty much, yes. Not all though.
 * If it doesn't, should we consider expanding that section? Absolutely. For example, magic word is linked but per MOS:NOFORCELINK "Do not unnecessarily make a reader chase links: if a highly technical term can be simply explained with very few words, do so."
 * Regards, Thinker78  (talk) 19:21, 10 September 2023 (UTC)
 * Let's put this another way - First, putting wiki syntax in the middle of a "nowiki" example is counter productive.
 * Second, linking to something that only exists to prevent misunderstanding and mis-use, is also counter productive.
 * the template exists exactly because some people misunderstand what a magic word is. Just as you did initially in this discussion. It exists to inform the editor that they made a mistake. If they see it, they made a mistake that needs fixing. It's never to intentionally be used - especially not in an example where we're trying to show users what to properly do. - jc37 23:17, 10 September 2023 (UTC)
 * Ok, therefore I think Primefac's questions are relevant in seeking a compromise. Regards, Thinker78  (talk) 00:55, 11 September 2023 (UTC)
 * Oh, if you are willing to add in the missing content on the help page, I think that's excellent and have no issues. The template docs are all made under the same license as any page, so you can even copy text directly and put something like "(Copied from Template:DEFAULTSORT/doc) in the edit summaries for attribution. Good luck! Rjjiii (talk) 03:40, 11 September 2023 (UTC)

Explicit DEFAULTSORT same as page-title
Is there any technical effect of doing  on page "Foo"? If not, is there any value to having it (other parsers, bots, etc.)? DMacks (talk) 09:52, 11 January 2024 (UTC)
 * I don't know of any present-day reason. I can think of two reasons that applied in the past, but which no longer apply:
 * Pages not in mainspace would at one time be sorted by their namespace, i.e. Help:Category would be sorted under H and not C - nowadays the namespace is ignored so it sorts as "Category".
 * Sortkeys were at one time case-sensitive, moreover, "a" sorted after "Z", so an article like Rock parrot would have  - now, "p" sorts with "P"
 * Which pages did you have in mind? Do they fit either of the above situations? -- Red rose64 &#x1f339; (talk) 19:13, 11 January 2024 (UTC)
 * Thanks for the explanation! I saw an edit on my watchlist where an explicit DEFAULTSORT that did not match the title was changed to match the title. Can't find it now. But I'm generally interested in sorting in the field of molecular formulas, where we want a category to sort:
 * CH4
 * C5H8
 * C5H10
 * Thanks to the newish 'numbersort' feature (rather than strict string sorting), H10 comes after H8. But we want an implicit "1" after certain letter strings. Easy enough to write a template that would emit 'DEFAULTSORT:C1H4' on the CH4 page. But then I was wondering if there were any side effects of having that template on every page (not just the ones that needed it), so 'DEFAULTSORT:C5H8' on the C5H8 page. DMacks (talk) 20:01, 11 January 2024 (UTC)
 * You should only need to do this on those pages that would otherwise sort in the wrong order. -- Red rose64 &#x1f339; (talk) 21:35, 11 January 2024 (UTC)
 * If a page has multiple DEFAULTSORT after all transclusions are performed then only the last is used. Sometimes a DEFAULTSORT is added unintentionally by a template. If a page has DEFAULTSORT and is moved without updating DEFAULTSORT then it may sort inappropriately. It may confuse editors if such a DEFAULTSORT is transcluded from a template. If your intended template works automatically from the page name then I guess this will not be an issue. PrimeHunter (talk) 00:43, 12 January 2024 (UTC)
 * Right. I occasionally work on resolving Category:Pages with DEFAULTSORT conflicts. Yet another reason to avoid needlessly asserting the default value explicitly. My intended use is a pile of setindex articles (as part of the Molecular formula index footer template) and redirects (as part of R from molecular formula tag). In both cases, the use is limited to molecular-formula pages, to enable proper sorting by molecular formula. DMacks (talk) 01:05, 12 January 2024 (UTC)
 * If there are two or more DEFAULTSORT with different values, it does use the one that is last in the page code after template expansion, but it also throws an error, see . -- Red rose64 &#x1f339; (talk) 18:24, 12 January 2024 (UTC)
 * An error can be suppressed with . Replacement of an earlier DEFAULTSORT can be avoided with  . PrimeHunter (talk) 13:47, 13 January 2024 (UTC)

DEFAULTSORT needs a new name
I've been editing WP assiduously for over 20 years, in which time I have corrected literally thousands of Defsorts that have been incorrectly specified.

The main offender is personal names, where we typically need the article to be sorted by surname, not by given name. For ex, Mervyn Jones would be Defsorted as "Jones, Mervyn". Simple, right? Well, it seems many, many editors just don't get it. They Defsort it as "Mervyn Jones", not realising that that produces exactly the same result as if Defaultsort were not used at all. In other words, whatever order the words are in the article title, will dictate the sorting of the article in its categories. That's UNLESS we use a Defaultsort using a parameter that is something OTHER than an exact copy of the article title.

What I'm getting to is this: The default sorting will be the article title, yet to change it to something else, we must use a magic word that includes the word "Default". That has always, always, always seemed counterintuitive to me. If you had a choice to either Keep or Change something in any sort of app, and you wanted to change it, you'd click the Change button, not the Keep button. Right? Same with Defaultsort, which is used when you actually want something OTHER than the actual default, which is the article title.

I'm certain that this simple bit of infelicitous nomenclature is the root cause of so many editors getting so wrong what to experienced editors is the simplest concept imagineable.

Is there any prospect of changing the name to something more likely to produce better outcomes? One idea might be CHANGESORT. I'm sure there are many others. -- Jack of Oz   [pleasantries]  04:08, 10 April 2024 (UTC)
 * DEFAULTSORT has been around for . It's a bit late to ask for it to be changed. -- Red rose64 &#x1f339; (talk) 16:04, 10 April 2024 (UTC)


 * And yet I'm asking. Your response is no argument against such a change. An analogy might be: Sending 12-year-old boys down the mines has been around for hundreds of years, so it's a bit late to raise the minimum age now.
 * On reflection, maybe this issue would best be raised @ Wikipedia talk:Categorization, so I'm moving it there. -- Jack of Oz   [pleasantries]  20:50, 10 April 2024 (UTC)