Share » Forums » Developer » numeric attribute_filter on "Text...

numeric attribute_filter on "Text Line" attribute

numeric attribute_filter on "Text Line" attribute

Monday 17 September 2007 7:51:41 am - 5 replies

Author Message

Olivier Ouin

Monday 17 September 2007 8:33:40 am

And alphanumeric sort result is different of a pure numeric sort with numeric strings ??
Strange ...

You should see how works extended attributes filter, you can do some complex queries with it.

Personnaly, I would build my own custom fetch method in an extension, it's not really difficult.
In it, you could "normally" fetch your nodes, associate it in an array with the line text content, parse the array to convert the line text content to a pure numeric type, then sort it according to numeric values, and finally return the sorted nodes.

Sébastien Morel

Monday 17 September 2007 9:33:07 am

Ok, I would say "alphabetic sort" with "Text Line" attribute .(it's a little vocabularary differences ;))

In fact in my case 205 is lesser than 60 because eZ sort in alphabetic mode because the type of my attribute is "Text line".

Someone else have a idea ?

Thanks

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

André R.

Monday 17 September 2007 11:52:13 pm

You should probably convert it using ezchangeclass, you can write custom converter code for the ezstring to ezint conversion.

It's quite simple, you only need to map data_string to data_int.
PS: ezchangeclass contains a couple of known bugs, so I will upload the new version later today!

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Sébastien Morel

Tuesday 18 September 2007 1:09:18 am

I was expecting such an anwser...

Is there another way ?

Thanks anyway ;)

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

André R.

Tuesday 18 September 2007 2:44:18 am

hmm, not that I can think of right now, but added a string to int/float converter my self.
So you can give it a test straight away:

http://ez.no/community/contribs/applications/object_content_class_change

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu