Page MenuHomePhabricator

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

Description

Author: beesley

Description:
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
URL: http://en.wikipedia.org/wiki/Category:Nature

Details

Reference
bz243

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:

Category:Music

''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:

Code:
In columnList(), line 259:
$r .= "<h3
id=\"{$articles_start_char[$index]}$cont_msg\">{$articles_start_char[$index]}$cont_msg</h3>\n<ul>";

function shortList( $articles, $articles_start_char ) {

$r = "<h3

id=\"{$articles_start_char[0]}\">".$articles_start_char[0]."</h3>\n";

$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

id=\"{$articles_start_char[$index]}\">{$articles_start_char[$index]}</h3>\n<ul>";

}

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