Page MenuHomePhabricator

Default sortkey should not contain the page namespace
Closed, ResolvedPublic


Author: kellen

On wikibooks, we have categories for books. One of the issues with this is that
when categorizing either books in namespaces like "Cookbook:Recipe name" or
books with subpages like "Calculus/Vectors" users must add a sort key (or the
special blank one) to every single module in the entire book to get them to sort
properly . This is repetitive and error prone; consider that some cookbook pages
have 7 or more categories.

There should be a way to mark the category page with a default sort key which
would be inherited by all the pages added to it provided they did not have an
overriding sort key. For example, a category could have SORTPAGENAME added
to it and the namespace would be ignored when sorting ("Cookbook:Recipe name"
sorted as "Recipe name"), or it could have SORTSUBPAGENAME and the prefix
would be ignored ("Calculus/Vectors" sorted as "Vectors").

Version: unspecified
Severity: enhancement



Event Timeline

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

dhanak+mediazilla wrote:

Many-many templates contain the "ugly" {{PAGENAME}} variable to avoid sorting by
the namespace name. This is error prone (can be acidentally omitted very
easily) and ugly.

braker wrote:

I also request this feature but need another sort-criteria "SORTPAGEAGE" to
sort pages by their age, when they where created. The german wikibooks uses a
special sortkey, to keep track of new wikibook-candidates. They will be listed
in a special category until a few month passed. They are sorted by date of
creation, Books listed first are oldest. After beeing a candidate, they will be
deleted or they aquire book state.

if not possible, i request a variable {{CREATIONTIMESTAMP}} which returns a
timestamp formatted like {{CURRENTTIMESTAMP}} containing the timestamp of the
creation of a page.

wknight8111 wrote:

I agree that this would be useful, time-saving, and it would make categories more useful.
It would save every single page from having to resolve the {{PAGENAME}} variable, for
every single category for which it is a member.

0p9usag02 wrote:

Note that English wikibooks now uses the Book/SubPage convention for indidivual
books, not Namespace-like things like Book:.

My proposal would be to have a syntax like
where the slash indicates that we should use the pagename as the sorting key,
(so S for SubPage, not B for Book)

braker wrote:

Maybe the Sortcriteria should be optional too, a defaultvalue and a force value.

[[Category:Foo]] May indicate to use default sort, which is specified on
Category Page.
[[Category:Foo|A Sortvalue]] Forced to sort this Page equal to "A Sortvalue",
which will be found under "A".

This, would be easier for the migration process into an improved
Category-System. So the
Namingconvention might not be a big problem. Is there a Syntax Proposal for this
improved Category system ?

kellen wrote:

Both of the last comments have missed the point.

The point is to change the sort method ON THE CATEGORY PAGE ITSELF, so we don't
have to resort to silly tricks on every member of the category.

Also, the wikibooks Cookbook does have a namespace, so this is still an issue.
And Maxim's last idea is what is already implemented.

braker wrote:

I mean, the system should support both styles. When the default mode
is used, ([[Category:Foo]]) the Sortkey should be used from the
Category page, but when a Sortvalue is given, this should be used
instead. The Defaultkey - whether Subpage, Pagename, fullpagename, Pageage or
anythin else should only be applied, if no special Sortvalue is given.

I hope this comment is more precise.

leon wrote:

Fixed in SVN trunk, r38992.
Set the switch $wgCategoryPrefixedDefaultSortkey to false to get a sane default sortkey. However, that switch is currently set to true on wikimedia wikis.

  • Bug 12351 has been marked as a duplicate of this bug. ***