
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! Regards, Cliff Stefanuk - Customer Service Manager [email]support@interactivetools.com[/email]
|