Closed (fixed)
Project:
Directory
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
19 Dec 2006 at 18:48 UTC
Updated:
31 May 2007 at 16:33 UTC
Jump to comment: Most recent file
The current implementation shows nodes in natural (nid) database order.
It would be nice if we could sort the nids by title.
This is complicated by the fact that the code is not currently structured in a way that will allow this to be implemented quickly.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | sorting.directory.patch | 2.12 KB | beginner |
Comments
Comment #1
beginner commentedWhich query is involved, in which function?
I guess there is no ORDER BY at all in the sql, but I still get a page where the listed nodes are not listed by nid (maybe because of deleted nodes).
What kind of ordering would be most natural? By title? By date published? By date updated?
I can provide a patch for this, but at this stage, I would welcome some pointers because the code is hard to follow, especially since the documention does no seem to correspond to the code.
E.g. the names of the variables, and the TYPE do not match here:
Comment #2
beginner commentedis the following issue a duplicate of this one?
http://drupal.org/node/111434
If so, a patch for it already exist at #11 http://drupal.org/node/93031#comment-224251.
I would only need to extract it from the Upgrade patch.
Comment #3
beginner commentedAttached is the patch I am committing.
We can sort according to 4 values: sticky, created, changed and title.
In this patch, I am sorting according to what I think would be the most commonly used and logical manner to sort: first by sticky, then by date changed (i.e. by the date the node has last been edited).
Later, in another issue, I am going to propose simple improvements in the way the nodes are listed, adding the name of the author, date published and the 'updated' marker, so this way of sorting is the most logical.
If you disagree, the sorting can be easily updated (with another, simpler patch).
Comment #4
beginner commentedAbout #1 and the faulty documentation: I have committed a small patch (all in the Drupal-5 branch only), which corrects and improves a bit the documentation.
Since this issue is about sorting the nodes, and I have already committed the patch above, I set this issue as fixed.
Reopen if you want to discuss further in which way to sort.
Comment #5
(not verified) commented