Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-05 21:37:52

richtestani
Plugin Author
Registered: 2009-11-08
Posts: 128

Proper sorting by number

I’m working with a collection of articles which I want to sort from a custom field.
The values in the custom field are integers.

Sorting on this results in:

1
10
11
12
13
2
21
22

How can get I get proper sorting?
Thanks
Rich

Offline

#2 2010-04-05 22:32:49

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Proper sorting by number

Results are sorted as strings, because the field type is varchar. You might get past it by trying something like:

sort="(custom_1+0) asc"

Hope it helps.

Offline

Board footer

Powered by FluxBB