Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Listings Manager Add-ons:
Sorting list after search

 

 


Louis
New User

Mar 13, 2006, 4:57 AM

Post #1 of 2 (2871 views)
Shortcut
Sorting list after search Can't Post

Is it possible to sort the search result page, in real time?

A user does a search and gets the listings page. At the top of the page a dropdown is located where the user can chose to sort the search results by a couple of predefined properties; like (in case of a realty website) price, m2 size, etc. And then another dropdown to chose between ascending and descending.


Cliff
Staff


Mar 13, 2006, 6:17 PM

Post #2 of 2 (2864 views)
Shortcut
Re: [Louis] Sorting list after search [In reply to] Can't Post

Hi Louis,

Thanks for posting.

The search results page is always served up 'on the fly' so when you are viewing the results of a search you are doing that in real time.

To setup sorting, what you can do is link to the search engine and use that to sort the listings on the specific field that you want. This doesn't mean that you need to have a page specifically dedicated to searching, it just means that you will need to use some of the extra features that the search can provide.

So, you'd have something like this as the HTML for the link to "Sort by Price":

<a href="$search_url$?search=1&sort_order=5,123,forward">Sort by Price</a>

Here's a breakdown of what is in the "sort_order" attribute:

5 - This specifies which field you will be sorting on. By default 'Price' is in field 5 so this example uses '5'. If you're using a different database field you'll want to make the necessary change to the above code. For example if your address field is lfield1, then just change the number to 1 instead of 5.

123 - This means that the field will be sorted numerically. To sort a field alphabetically you can use "abc".

forward - Indicates that the prices will increase (smallest value is first in list, higher is last). If you'd like to show listings in the opposite order you can use "reverse" instead.

That should be what you need, but let me know if you have any questions! Smile
Regards,
Cliff Stefanuk - Customer Service Manager
[email]support@interactivetools.com[/email]