Page MenuHomePhabricator

Make table of contents for category pages: Subcategories, Pages, Media
Open, LowPublicFeature

Description

Author: dunc_harris

Description:
At the top of image namespace pages there is a Mediawiki namespace table of
contents leading to:
*Image
*File history
*File links
*Metadata.

There should be a similar at the top of categories leading to:

  • Subcategories (#mw-subcategories)
  • Pages (#mw-pages)
  • Media (#mw-category-media)

I suggest that there also should be a fourth leading to the bottom where it
shows the parent categories.

This ought to be easy to fix.


Version: unspecified
Severity: enhancement

Details

Reference
bz8178

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:32 PM
bzimport set Reference to bz8178.
bzimport added a subscriber: Unknown Object (MLST).

dunc_harris wrote:

PS

For those who are still confused, here is an example image page from the commons:

http://commons.wikimedia.org/wiki/Image:Cambridge-longplatform-south-06.jpg

In the html the bit at the top is called "filetoc", though I cannot find it in
[[Special:Allmessages]]. Copy the formatting anyway; it should come after the
title but before the text.

I've found the anchor tag for the parent categories and it is #catlinks, so add
that too.

Hope that gives you a better idea of what is needed.

ayg wrote:

(Note: not related to bug 1502, clarifying summary. I don't actually think this is easy to fix, since the TOC is currently generated by the Parser from wikitext, I think, in which case it needs to be abstracted out before it can be properly fixed.)

This would be very easy to do, if we do it just like with files. (has the potential of having 2 tocs in that case, but having so much content in a category page that the content toc is actually triggered is rather rare I think.)

The question is, do we really want it.

Note that the opener is referring to #filetoc not #toc.

In other words the horizontal grey bar on top of File-pages [1]. So the parser isn't related as much.

[1] http://en.wikipedia.org/wiki/File:Example.jpg

The TOC on category pages already works for wiki markup section headings. The only thing that's missing are the automatically generated section headings.

(In reply to comment #3)

This would be very easy to do, if we do it just like with files. (has the
potential of having 2 tocs in that case, but having so much content in a
category page that the content toc is actually triggered is rather rare I
think.)

The question is, do we really want it.

Yes, ESPECIALLY when there is a lot of content on a category page. For example, I have a root (or "top") category that turns out to be a good place for documenting why things are organized the way they are (login with Demo/test):

http://www.coincompendium.com/w/index.php/Category:Core

There's several wiki markup section headings that you have to scroll through before you can find the auto-generated category information headings. The size of that Core category just keeps getting bigger as the wiki grows, and a TOC becomes more and more useful for navigating it.

sumanah wrote:

badon, would you be interested in using developer access https://www.mediawiki.org/wiki/Developer_access to implement this in MediaWiki?

Yes, I am interested, but it will take me a ridiculous amount of time to get up to speed enough to feel confident in doing something novel and useful. I would prefer to achieve that by studying code and internally documenting it with code comments to a level of detail and verbosity that comments could dominate the code. As I'm sure you're aware, I'm not exactly a beginner programmer, but I consider myself to still be quite unfamiliar with PHP and the MediaWiki code base. So, my comments may seem pedantic or annoying from the point of view of someone who is already past that entry-level learning curve, although I've never actually had anyone complain in other projects I've worked on.

Mediawiki is the largest collaborative project I have been involved in, and I have noticed perhaps 1 or 2 WMF-affiliated developers that seem to do things like I do, but they're unusual (and quite important, talented WMF contributors). If there's no problem with me starting small with just basic things like comments, then progressing to code cleanup, etc, then I think I'm ready to begin advancing to more direct contributions to MediaWiki and WMF using developer access.

The upside to starting this way is if I screw something up due to inexperience, it's only comments that don't break anything. I love starting small.

What do you think, Sumana?

shreeshikha21 wrote:

I am new to FOSS and mediawiki how do I start on this bug and how do I replicate the error on my local machine.

Removing 'easy' keyword per discussion with Legoktm at Wikimania 2014 who couldn't work out how this was easy to do because the sections of code that work out if the category has members and the outputting of the page are in two different classes?

I know some stuff about MW and I spent a large amount of a day trying to work out how to do this bug without rewriting the entire of the Category page system.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.