Help talk:Category

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconWikipedia Help NA‑class Mid‑importance
WikiProject iconThis page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
NAThis page does not require a rating on the project's quality scale.
MidThis page has been rated as Mid-importance on the project's importance scale.
WikiProject iconCategories
WikiProject iconThis page is within the scope of WikiProject Categories, a collaborative effort to improve the coverage of categories on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.

Revamping the category pages[edit]

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)[reply]

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)[reply]
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)[reply]

Section wording – Putting pages into categories[edit]

The section Help:Category#Putting pages into categories begins A page belongs to a category if the page's wiki markup contains a declaration for that category.

Seems awkward and cart before the horse.

Many editors link to this section when reverting improper edits to category pages. It should read as if to a new editor, who wants to categorize a page, but does not know how. Just a suggestion: If a page belongs to a category, then the declaration for that category should be placed at the bottom of its page.

The current wording isn't even necessarily true. Anyone, including the person you are reverting, could have added (incorrectly) the category declaration. Doesn't mean the page actually belongs. --DB1729 (talk) 20:53, 20 September 2021 (UTC)[reply]

Request for comment on category namespace[edit]

Should we make the pseudo-namespace CAT: become an alias to the category namespace like in Commons? Vitaium (talk) 14:18, 24 January 2022 (UTC)[reply]

@Vitaium: This is the wrong place to make such a proposal, it is the talk page for discussing improvements to the page Help:Category. You should really discuss this at WP:VPR; and to begin with, stick to discussion - don't make it a formal RfC unless that is what others agree to. See WP:RFCBEFORE. --Redrose64 🌹 (talk) 20:41, 25 January 2022 (UTC)[reply]

External links[edit]

Is an external link sufficient to support a category for a page? I thought that support for a category had to be within the text of the article, but I don't know of a source that says so. I'm asking because I removed a burial category from Gloria Wood and another editor reverted the removal with the edit summary "its supported by the Find a Grave link in the external links". Find a Grave is not a reliable source for text in an article, so I don't know why it should be valid for supporting a category. Eddie Blick (talk) 01:35, 27 December 2022 (UTC)[reply]

@Teblick: This is WP:CATV. If the category is not verifiable, it cannot be added. --Redrose64 🦌 (talk) 08:21, 27 December 2022 (UTC)[reply]
Thank you, Redrose64. I was not aware of that documentation. I appreciate your help. Eddie Blick (talk) 19:21, 27 December 2022 (UTC)[reply]

@Thinker78: I don't think that {{tlx|DEFAULTSORT}} 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)[reply]

@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)[reply]
Just because something has braces, does not make it a template.
See also: mw:Help:Magic words. - jc37 08:14, 7 September 2023 (UTC)[reply]
Right, {{DEFAULTSORT:Sortkey}} 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.[1] I have removed the link but changed {{DEFAULTSORT}} to {{DEFAULTSORT:}} to show the colon right away.[2] If you write {{DEFAULTSORT}} 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)[reply]
Well, if the guideline is telling people to use {{DEFAULTSORT}} 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, "{{DEFAULTSORT:<sort key>}} 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)[reply]
Pinging @SMcCandlish: (a template editor). Thinker78 (talk) 04:06, 8 September 2023 (UTC)[reply]
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 {{DEFAULTSORT}} template is deprecated in favor of the {{DEFAULTSORT:}} 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)[reply]

TEMPLATE:DEFAULTSORT might be added to the See also list at Help:Category#Default sort key but your edit was confusing. It said:

It is possible to set a default sort key which is different from {{PAGENAME}} by using the magic word {{DEFAULTSORT}}:

{{DEFAULTSORT:new key}}

But {{DEFAULTSORT}} 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 {{DEFAULTSORT|new key}} instead of the correct {{DEFAULTSORT:new key}}. Without the template, {{DEFAULTSORT|new key}} 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)[reply]

What about adding the wikilink to the text in this manner, "{{DEFAULTSORT:}}"? Regards, Thinker78 (talk) 03:44, 9 September 2023 (UTC)[reply]
Because that links to the template, which is precisely what we don't want. I have refined the link to take people to the most relevant section. --Redrose64 🌹 (talk) 15:03, 9 September 2023 (UTC)[reply]
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)[reply]
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)[reply]
@Thinker78: 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)[reply]
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)[reply]
@Stemonitis: Thinker78 (talk) 23:41, 9 September 2023 (UTC)[reply]
If I could take a step back - we're talking about Help:Category § Default sort key, 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)[reply]
  • "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)[reply]
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)[reply]
Ok, therefore I think Primefac's questions are relevant in seeking a compromise. Regards, Thinker78 (talk) 00:55, 11 September 2023 (UTC)[reply]
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)[reply]

Explicit DEFAULTSORT same as page-title[edit]

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)[reply]

@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)[reply]
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:
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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 sandbox. --Redrose64 🌹 (talk) 18:24, 12 January 2024 (UTC)[reply]
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)[reply]