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

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.
In T188050#3998476, @GeoffreyT2000 wrote:

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).

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

The biggest driver seems to be 3rd party use.

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.