Page MenuHomePhabricator

Add anchor tags to the headers used on category pages
Closed, DeclinedPublic


Author: beesley

Please add id names to the headers in CategoryPage.php so that sections such as
"Subcategories" and "Articles in category whatever" can be linked to. For
example, $r .= "<h2 id=\"{$h}\">{$h}</h2>\n" ;
instead of
$r .= "<h2>{$h}</h2>\n" ;

This would be useful for categories with a lot of text before the list of
articles begins so people can add links like See list of articles in this category at the top of the page. People
might not know to scroll to the end otherwise.

Version: 1.3.x
Severity: enhancement



Revisions and Commits

Event Timeline

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

wikimedia-bugzilla wrote:

Yeah, we need ids for all (H2 or lower) headers (as a matter of principle).

I've been thinking about navigation too - how about a default template for
categories, something like:


''Main article:'' [[Music]] (if there is an article called "Music" exists)
*Subcategories (if there are subcategories)
*List of articles in this category

avarab wrote:

id="Subcategories" and id="Articles" perhaps?

evilmrhenry wrote:

In columnList(), line 259:
$r .= "<h3

function shortList( $articles, $articles_start_char ) {

$r = "<h3


$r .= '<ul><li>'.$articles[0].'</li>';
for ($index = 1; $index < count($articles); $index++ )
     if ($articles_start_char[$index] != $articles_start_char[$index - 1])
     $r .= "</ul><h3



     $r .= "<li>{$articles[$index]}</li>";
     $r .= '</ul>';
     return $r;

dunc_harris wrote:

They are implemented. Use the following:

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

wikimedia-bugzilla wrote:

Just to clarify, these are the id attributes of the div surrounding each H2 section.

epriestley changed the task status from Declined to Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:19 AM
epriestley added a commit: Unknown Object (Diffusion Commit).
Aklapper changed the task status from Resolved to Declined.Mar 4 2015, 11:30 AM
Aklapper claimed this task.