Help talk:Category

{{User:MiszaBot/config

|maxarchivesize = 70K

|counter = 2

|algo = old(365d)

|archive = Help talk:Category/Archive %(counter)d

}}

{{WikiProject banner shell|

{{Wikipedia Help Project|class=NA|importance=mid}}

{{WikiProject Categories}}

}}

{{archives}}

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 phab:) to do it another way. That has little change of being accepted, so you should consider using a list, see Wikipedia:Categories, lists, and navigation templates. --Redrose64 🌹 (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)

Explicit DEFAULTSORT same as page-title

Is there any technical effect of doing {{DEFAULTSORT:Foo}} on page "Foo"? If not, is there any value to having it (other parsers, bots, etc.)? DMacks (talk) 09:52, 11 January 2024 (UTC)

:{{replyto|DMacks}} 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 {{DEFAULTSORT:Rock Parrot}} - now, "p" sorts with "P"

:Which pages did you have in mind? Do they fit either of the above situations? --Redrose64 🌹 (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. --Redrose64 🌹 (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 {{tl|Molecular formula index}} footer template) and redirects (as part of {{tl|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 {{oldid|Wikipedia:Sandbox|1195187524|sandbox}}. --Redrose64 🌹 (talk) 18:24, 12 January 2024 (UTC)

::::An error can be suppressed with |noerror. Replacement of an earlier DEFAULTSORT can be avoided with |noreplace. PrimeHunter (talk) 13:47, 13 January 2024 (UTC)

DEFAULTSORT needs a new name

{{hat|Moved to Wikipedia talk:Categorization}}

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 {{diff|Wikipedia:Categorization|prev|101417435|at least seventeen years}}. It's a bit late to ask for it to be changed. --Redrose64 🌹 (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)

{{hab}}