Page MenuHomePhabricator

Number of articles in subcategories shown on category page
Closed, ResolvedPublic

Description

Author: contactbox

Description:
When one looks at a category, say "category:X" usually it lists a variety
of sub-categories, and also a variety of assorted articles which belong to
category X.

Would it be possible next to each subcategory to give a count of the
number of unique pages within that sub-category?

The idea would be, to see at a glance which sub-categories had many
articles.

I understand that there is a risk of circularity in the counting, I don't
know if that makes it technically impossible. Thoughts?


Version: unspecified
Severity: enhancement

Details

Reference
bz3834

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:55 PM
bzimport set Reference to bz3834.
bzimport added a subscriber: Unknown Object (MLST).

This would probably be unnecessarily expensive.

wcpoon wrote:

What about just one level down? i.e. listing the number of immediate
sub-categories and the number of immediate pages that below to this category.
This prevents circularity, and also the running cost could be amortized as follows:

Each category keeps the two counts as part of its database entry.
When a page/category list this category as its immediate parent, the
corresponding count is incremented.
When a page/category delist this category as its immediate parent, the
corresponding count is decremented.
When this category is listed as a subcategory of its parent, the two counts are
furnished for display.

All the above operations take constant time.

dbw wrote:

I would also like to express my support for such a feature. Just brackets after
the sub category name, which contains the number of objects within that
category, wich I suppose should hold both pages and further subcategories.

FT2.wiki wrote:

append (X/Y)

where X = direct member articles and Y = direct member subcategories?

This bug seems to be much easier now that bug 6943 has been fixed.

If I understand this bug report correctly, this already works on Wikipedia (probably through the CategoryTree extension). If not, please reopen the bug with a description what is still missing.