Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-08 15:58:27

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

sorting on multiple fields

hello everyone

we’re using textpattern 4.0.2 and I was wondering if I can use the built in txp_search function to sort on multiple fields?

something like

<txp:article listform=“search_results” limit=“200” sortby=“Title, Posted” sortdir=“desc” />

Any help greatly appreciated as always.

Offline

#2 2007-11-08 16:44:09

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: sorting on multiple fields

You can sort with multiple crieteria, as seen here

sort="Title desc, Posted asc"

Last edited by mrdale (2007-11-08 16:44:24)

Offline

#3 2007-11-08 17:15:39

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: sorting on multiple fields

mrdale wrote:

You can sort with multiple crieteria, as seen here

Not in 4.0.2. But upgrading is easy :)

Offline

#4 2007-11-08 17:23:15

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: sorting on multiple fields

wow 4.02 was forever ago… forgot.

Offline

#5 2007-11-08 19:14:23

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: sorting on multiple fields

Thanks for your replies.

Thought as much. :-(

We’ve written alot of bespkoke plugins, and I’ve been told that they’ll all get mangled up when we upgrade.

Actually, I should find out if that’s true or not really.

Out of interest, what version would I need to upgrade to in order to use sorting on multiple fields?

I seem to remember reading about sort as opposed to sortby being introduced in one version of TXP where you can put genuine sql queries in, is that right?

Offline

#6 2007-11-08 19:41:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: sorting on multiple fields

vanderkerkoff wrote:

<txp:article listform="search_results" limit="200" sortby="Title, Posted" sortdir="desc" />

Did you actually try this? I seem to remember that Mary once posted something similar, but of course I can’t find it now.
That said, you should really upgrade :) It must have been 4.0.4 or 4.0.5 where the sort attribute was introduced, but if you are going to upgrade anyway, why not 4.0.5?

Offline

#7 2007-11-08 19:47:03

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: sorting on multiple fields

Hi Els

Yes mate, I did try it, no joy.

Offline

#8 2007-11-08 19:52:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: sorting on multiple fields

Just found I had bookmarked it :) Try this.

(and still: upgrade!)

Last edited by els (2007-11-08 19:54:06)

Offline

#9 2007-11-13 14:34:33

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: sorting on multiple fields

Hi fellas, thanks for getting back to me

I’ve upgraded now, but the search form isn’t recognising the sort parameter, it still recognises sortby though

any ideas?

<txp:article sort=“Title asc” />

gives me no results

<txp:article sortby=“Title” />

works

thanks in advance

Offline

#10 2007-11-13 15:46:18

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: sorting on multiple fields

anyone?

I’m getting really desperate here, I was advised to upgrade so I could use this sort parameter, I had a hell of a time upgrading but I’ve managed to get there now, but the sort parameter does not work.

So, at the moment it’s been a complete waste of my time/money that I can’t afford.

Someone please get back to me.

Offline

#11 2007-11-13 22:30:32

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: sorting on multiple fields

Diagnostics results and tag trace please.

Last edited by Mary (2007-11-13 22:30:54)

Offline

#12 2007-11-14 14:41:46

vanderkerkoff
Member
Registered: 2005-05-26
Posts: 45

Re: sorting on multiple fields

has anyone got any ideas why sort wouldn’t work after an upgrade?

any at all?

Offline

Board footer

Powered by FluxBB