sort the contents of the block by creation date, modified date, alphabetically and by importance

darumaki - August 13, 2008 - 02:32
Project:Similar By Terms
Version:6.x-1.18
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Is there a way to sort the pages that show up in the tag block ?

#1

rmiddle - August 13, 2008 - 02:53

??? The page is sorted but relevance. I might not understand what you want.

Thanks
Robert

#2

darumaki - August 13, 2008 - 06:30

in the block where this module displays tagged pages, the links are not sorted and the normal weight option apples to the regular menus not this module, I was just curious if there might be a way.

#3

rmiddle - August 13, 2008 - 13:24

If I understand you right. No the links inside the block do not take weight into account.

Thanks
Robert

#4

Rob T - September 19, 2008 - 18:18

I needed an alphabetical sort at the very least. For my purposes, time created wasn't the default sort I desired.

In similarterms.module ... I changed this (around line 181 and again, around line 196)
'ORDER BY ncount DESC, n.created DESC '.
to this
'ORDER BY ncount DESC, n.title ASC, n.created DESC '.

#5

rmiddle - September 19, 2008 - 18:31

That might break things. Need to look a little closers it to that.

Thanks
Robert

#6

rmiddle - December 6, 2008 - 01:55
Status:active» won't fix

Going to mark this as wont fix since this isn't a standard use.

Thanks
Robert

#7

Pixelstyle - February 12, 2009 - 16:32

Would it be a lot of trouble to add an option to the block config, to sort the contents of the block in a few ways?

I'm thinking creation date, modified date, alphabetically and by importance (and for all asc/desc).

It would sure help me and probably quite some other users as well.

#8

rmiddle - February 12, 2009 - 17:02
Title:Sorting option ?» sort the contents of the block by creation date, modified date, alphabetically and by importance

Dupe

#9

rmiddle - February 12, 2009 - 17:01
Status:won't fix» postponed

If you change the sort order in the query you change the results. Since we grab the 1st X results default is 5. The only way to change the sort options and still keep what you are getting is to sort the array after it is grabbed from the database. It is doable but add more processing power to an already pretty processor hungry process. If time permits I might look into ways to do this or if someone submits a patch I will include it.

Thanks
Robert

#10

rmiddle - February 12, 2009 - 17:05

Come to think about it there might to two ways to sort thing and both would have diff effect on your results. I need to think about this one for a while.

#11

rmiddle - February 12, 2009 - 18:09

Ok after a few min of thinking about it there are two ways to sort one is before the results are generates that will favor instead of the newest it would favor the sort type in the mod above it would favor items starting with a. The 2nd sort option is after it generates it results you sort those results that will return the same results but display then in different order. I think sorting by newest or oldest are the only sort options that should be used. Now sorting the results after they are returned that can make some since.

Thanks
Robert

#12

rmiddle - March 29, 2009 - 22:34
Version:6.x-1.9» 6.x-1.18
Status:postponed» active

Need to put some time into this. Bumping it up.

#13

tomsm - May 11, 2009 - 19:20

Hello, I would like to sort similar terms that have the same importance alphabetically. Will this feature be added?

Thanks!

#14

rmiddle - May 17, 2009 - 16:18

tomsm,

I have been busy so I haven't had a change to work on this. The issue is that it will require sorting the array after it is returned from the sql query. That will add processing cost to do so. However with the new caching stuff that will likely reduce that load some. When I have a change I will need to adding post processing sorting.

PS. It can be done by editing weblinks.tpl.php and sortting the array there.

Thanks
Robert

 
 

Drupal is a registered trademark of Dries Buytaert.