Template links on article preview page should be in alphanumeric (alphabetic) order
Closed, ResolvedPublic

Description

Author: greg.ebdon

Description:
See also bug 12532, and bug 12532, comment 4.

Basically, it would be very useful if the links to all the templates used in a page could be sorted in alphanumeric order for ease of finding a particular one. Obviously they're all in the same namespace, so just the BASEPAGENAME needs to be sorted. IIRC, they're currently in a random order - it might also be possible to have either a small link or an option in preferences to put them in the order they're used in the page.


Version: 1.12.x
Severity: enhancement

bzimport added projects: MediaWiki-Interface, Easy.Via ConduitNov 21 2014, 10:02 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz12644.
bzimport created this task.Via LegacyJan 15 2008, 7:15 PM
cneubauer added a comment.Via ConduitJan 15 2008, 9:45 PM

They aren't necessarily in the same namespace. You can transclude a page from any namespace and it'll show up in the template list.

bzimport added a comment.Via ConduitJan 16 2008, 6:51 PM

greg.ebdon wrote:

(In reply to comment #1)

They aren't necessarily in the same namespace. You can transclude a page from
any namespace and it'll show up in the template list.

This is true... I hadn't thought of that. Another I was planning to ask was if a feature could be implemented to link to substed templates on a preview page as well (e.g. if you've added a template in your current edit, you have to remove the subst: to get it to show up in the list, then replace it when saving. You think that might be useful?

Chad added a comment.Via ConduitJan 27 2008, 4:26 PM

Created attachment 4590
Patch to Linker.php as of r30183

I'm not sure if this works. It seems almost /too/ easy. Can someone more
familiar with this part of the code take a look? Thanks.

Attached: linker.patch

bzimport added a comment.Via ConduitMay 4 2008, 10:21 AM

greg.ebdon wrote:

(In reply to comment #3)

Created an attachment (id=4590) [details]
Patch to Linker.php as of r30183

I'm not sure if this works. It seems almost /too/ easy. Can someone more
familiar with this part of the code take a look? Thanks.

Whether with ^demon's patch or not, this feature seems to have been implemented - look at a few multi-template articles to confirm. Can someone confirm this code-wise and mark the bug resolved, please?

brion added a comment.Via ConduitMay 7 2008, 1:56 AM

They'll be sorted on initial view because they're pulled from the database in indexed order; but on preview, they'll appear in the order of parsing.

brion added a comment.Via ConduitMay 8 2008, 11:17 PM

(The previously attached patch doesn't work for two reasons: sort() doesn't return a value, breaking the array, and the sorting doesn't handle the title objects correctly.)

Fixed in r34485.

On initial edit, items were sorted by virtue of being pulled from a sorted table, but on preview they were displayed in rough order of use in parsing, which is a bit less legible.

Added Title::compare() static comparator available as a callback for usort(), using it in Linker::formatTemplates().

brion added a comment.Via ConduitJul 19 2009, 7:32 PM
  • Bug 19426 has been marked as a duplicate of this bug. ***

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.