Page MenuHomePhabricator

Allow filtering categories by namespace
Open, Needs TriagePublic

Description

Currently, beyond the built-in division between subcategories, files, or other pages, there is no distinction made between category members which are in different namespaces. Normally, this behavior is ideal, which is why it was made the default years ago. However, there are situations where more specific or user-controlled namespace filtering would be useful, e.g. listing (or excluding) all user pages in tracking categories.

This can currently be approximated with Special:Search using incategory: and limiting results by namespace, though that method requires Extension:CirrusSearch to work, so many third-party wikis probably can't use it. For tracking categories, it can also be achieved by modifying the relevant system message (e.g. the English Wikipedia split up their "Category:Pages with broken file links" into separate categories for ns:0 articles, templates, and other pages, by modifying their MediaWiki:Broken-file-category message in 2011, though @brion noted at the time that it may not work as expected [though I don't know if MediaWiki has been modified since then to make that use case behave better]), though a wiki may prefer to have only a single tracking category for a given tracked error, for any of a number of reasons.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 15 2018, 7:00 PM
Vvjjkkii renamed this task from Allow filtering categories by namespace to itaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from itaaaaaaaa to Allow filtering categories by namespace.Jul 2 2018, 4:54 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Dinoguy1000 updated the task description. (Show Details)Jul 4 2018, 9:21 AM
Dinoguy1000 added a subscriber: brion.
Dinoguy1000 updated the task description. (Show Details)Dec 16 2019, 12:36 AM

Categories are intentionally set up to show pages in all namespaces. Adding a drop-down box containing namespaces to filter by requires starting an RfC for consensus.

Why would this require an RfC? Especially if the default display mode is the same as it is now, i.e. all pages are displayed regardless of their namespace.

Agree, this shouldn't require a community buy in as long as the default was still "all pages" - adding a "filter" option (perhaps a collapsed one like in user contributions) would be non-intrusive to readers and could certainly be developed in stages. This would only be an output display filter, not actually changing categorizations. Suggest "namespaces" be tackled first as that seems to have the widest utility.

Just want to give this a big thumbs up. This is one of the features I miss most often and it would be great for dealing with polluted categories and awkward category trees such as Pages with long short descriptions and the categories for pages hitting template limits which are really badly polluted making them difficult to use (yes there are workarounds but doing it properly would be so much better).

Just want to give this a big thumbs up. This is one of the features I miss most often and it would be great for dealing with polluted categories and awkward category trees such as Pages with long short descriptions and the categories for pages hitting template limits which are really badly polluted making them difficult to use (yes there are workarounds but doing it properly would be so much better).

Izno added a subscriber: Izno.Jan 20 2020, 5:59 PM

On WMF wikis this can also be done with Petscan, on an aside.

The biggest driver seems to be 3rd party use.

Anomie added a subscriber: Anomie.Jan 20 2020, 6:44 PM

From a technical perspective, implementing this would likely require a cl_from_namespace column be added to the categorylinks table, along the lines of what was done for some other tables in rMWb8c038f6784e: Redo WhatLinksHere query and add a *_from_namespace field to link tables to resolve T62618: Very slow query for Special:WhatLinksHere limitted to a namespace when page has large number of backlinks.

That's not a showstopper, but does mean some extra work would be needed to create and populate the column beyond just adding code to add the option for filtering.