Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-04 06:04:28

progre55
Member
Registered: 2006-05-02
Posts: 668

rss_unlimited_categories: sorting on Custom Field Numeric Data

I have a list that is set to sort by a custom field.

The data in the custom field is prices.

I am running into trouble because although the sort is working correctly, it places the entry $3,250,000 on top of the entry $525,000.

This is the code I am using to work the sort:

<code>
<txp:rss_unlimited_categories_article_list section=“listing” form=“archive_posts” sortby=“custom_8” sortdir=“asc” />
</code>

If someone could guide me on how I can get it to look at the whole number rather than the first digit I would appreciate it.

Thanks in advance.

progre55

(Edit: updated thread subject to something a little more clear. -Mary)

Last edited by Mary (2007-01-04 19:15:52)

Offline

#2 2007-01-04 07:27:14

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: rss_unlimited_categories: sorting on Custom Field Numeric Data

Though I haven’t looked at the code this particular plugin uses to achieve sorting, you might succed with this:

<txp:rss_unlimited_categories_article_list section="listing" form="archive_posts" sortby="cast (custom_8 as unsigned)" sortdir="asc" />

Last edited by wet (2007-01-04 07:31:25)

Offline

#3 2007-01-05 14:27:36

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: rss_unlimited_categories: sorting on Custom Field Numeric Data

Wet:

I tried that and it jacked up the results. (ie no results showed)

I am going to try to see if Rob has an answer, but if you could take a quick look it would be much appreciated.

Thanks.

progre55

Offline

#4 2007-04-17 00:04:33

rohner
New Member
Registered: 2006-11-12
Posts: 7

Re: rss_unlimited_categories: sorting on Custom Field Numeric Data

Did Rob have the answer? I am having the same problem. The numbers won’t sort correctly above 100. Thanks!

Last edited by rohner (2007-04-17 00:04:52)

Offline

#5 2007-04-17 07:57:16

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: rss_unlimited_categories: sorting on Custom Field Numeric Data

Maybe the commas in the number are the trouble? Does it work if you cancel the comma ($3250000, $525000)?

Z-

Offline

#6 2007-04-17 15:47:18

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: rss_unlimited_categories: sorting on Custom Field Numeric Data

Try sortby="(custom_8 + 0)"

That should do a numeric sort.

Offline

Board footer

Powered by FluxBB