I'm working on a Drupal implementation which would need a different node sorting that the default 'order by n.created'. After looking, in vain, for any approach to this feature in the forums, I came up with a very simple module which does the job. The only 'problem' is that this would need to apply some patches to other core modules.

Now my question goes to core developers: do you think this approach to this functionality could be applied to the actual wortks on 4.7? If you look at the attached files we would only need to agree on the names of the variables to use into the core modules, and only into the ones that load and show any type of nodes.

I'm aware of the rushing to have a release candidate, however, I think this is a nice functionality to have with the new 4.7. If you agree with me, please, let me know and I will adapt this to the new form api and will work on the patches.

In any case, I will use this module for my project and would like to release it for 4.6 also. Any suggestions on this sorting.module would be appreciated.

The zip file includes a new sorting.module and a couple of patches for node.module and taxonomy.module. These files allow to choose three different types of ordering on promoted nodes and taxonomy lists: ordering by created, title and changed values.

As I said, any feedback would be very much appreciated.

Comments

kbahey’s picture

Robert

You may want to look at the Extended Tracker http://drupal.org/node/36756 here.

It may do some of what you want.

nedjo’s picture

A relevant issue posted a bit over a year ago:

http://drupal.org/node/10839

I still think some sort of sorting options within taxonomies belongs in core.

drumm’s picture

Please post one patach file for everything.

cvs diff -uF^f file1 file2 ...

The additional file can be posted in a separate followup.

robertgarrigos’s picture

StatusFileSize
new806 bytes

thanks drumm. I'll do that.

robertgarrigos’s picture

StatusFileSize
new1.71 KB
robertgarrigos’s picture

StatusFileSize
new1.59 KB

this is the last: the module itself.

robertgarrigos’s picture

StatusFileSize
new2.5 KB

sorry drumm, I just realize I missunderstood you.

use either this sorting.patch or the node and taxonomy patches attached to previous posts.

I have already posted the module itself with a previous post.

robertgarrigos’s picture

nedjo, we both did almost the same. my patch is even less 'agressive' with the core code, but you are right, there is no other way of sorting alphabetically than patching the core. I'm amazed that this functionallity hasn't been made available yet.

tostinni’s picture

If you look correctly at the thread mentionned by nedjo, I just told that such a patch had been commited to HEAD, so wait a little for 4.7 it will give you the tools to do what you need.

Then after 4.7 rolls out, I would advice you to post your module without patching the core ;)

robertgarrigos’s picture

sorry, I provably read that post too quickly. thanks.

irishsuperfly’s picture

I just wanted to say THANK YOU!!! This worked perfectly for my site and saved me from many headaches.

magico’s picture

Version: 4.6.3 » x.y.z
robertgarrigos’s picture

Version: x.y.z » 4.6.9
Status: Active » Closed (fixed)