Closed (fixed)
Project:
Views Natural Sort
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2009 at 06:23 UTC
Updated:
17 Apr 2012 at 16:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
domesticat commentedThis patch is a good idea, but it's replacing far too much text when it's just adding a couple of characters to one line in _views_natural_sort_filter_content()
Comment #2
brianbrarian commentedYeah, I thought that might be the case, but I am a patch n00b and not a coder. I only posted what came out when I ran diff; as I said, it did the trick for me.
Comment #3
danchadwick commentedI'm not sure of the status of this module's maintenance. I'm not using it personally, but I did look at it for ideas. In the interest of offering an improvement to both this and Numeric Sort - 546794 I offer you the following (untested) code. You'll find this in views_natural_sort.module, line 95.
I haven't tested this, except that I'm using essentially the same code in my module, and it works there. The changes are:
I hope this helps someone. Maybe it could make it into the module if it tests ok.
Comment #4
heatherann commentedHere is a patch which extends Views Natural Sort to filter out 'An' as well as the common French determiners (Le, La, L', Un, Une).
Comment #5
heatherann commentedWhoops, that was a patch of a patch. Here's the same patch that applies to the original module file.
Comment #6
neclimdulLooks very reasonable. Does this still need work?
Comment #7
heatherann commentedI'm happy with it. I'm using it on a multilingual site and it's working beautifully. Can it go in the next release of this module?
Comment #8
neclimdulDefinitely
Comment #9
ricky.ybarra commented@DanChadwick... works great. Thanks for sharing!
Comment #10
3cwebdev commented@DanChadwick - Thanks!! I spent quite a while researching how to sort a View alpha numerically on Node titles. I was surprised there was more chatter on this topic. I'm glad to have found this module and your mod to sort numerically. Works like a charm!
Comment #11
generalredneckThis is my personal opinion of this feature request... I think a "word" list should be provided for each language so that the correct words are replaced in the regex. Also we could switch based on the language we are in so that the regex won't be HUGE. I think this gears for "multilingual" support... at least with the patch in #5.
The patch will be in the next release, however, lets open up another issue for "multilingual" support to keep track of the "(Le, La, L', Un, Une)" additions.
@neclimdul what do you think?
Comment #12
danchadwick commented@generalredneck Take care with international. Many of those ignore-worthy words from foreign languages should also be ignored in the site's language. Just because my site is in English doesn't mean that I don't get content containing ignore words from other languages.
So, for example, La might need to be the ignore list for just about every language.
Comment #13
generalredneck@DanChadwick
Good, call... I think this feature needs more thought with that said. Maybe even taking this a little different direction than I initially thought.
Very valuable input though.
Thanks!
Comment #14
generalredneck@ DanChadwick in #3
Interesting solution, but I'm not sure that it would work for decimals, as it would place precedence over decimals that are longer... for instance
Say I had the numbers 3.1101 3.14, 3.121... the preg_replace would do something like...
013.041101 013.0214 013.03121 which would order them such that they are displayed as...
3.14, 3.121 3.1101
Very creative solution for sorting integers though. kudos indeed.
Comment #15
generalredneckThe patch was applied and will be available in the next version (6.x-1.1 & 7.x-1.1). Until then, you should be able to use the development version to get this fix. I'm in the process of closing out other tickets for the 1.1 release of both 6.x and 7.x.
Comment #16
3cwebdev commented#3 mod by DanChadwick works on the D7 version too! Thanks again!