[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Re-Sorting Search Results within a page


At 10:36 AM 12/30/2002 +0000, you wrote:
Ok. I must be thick. (Who said yes you are?!!)

Anyway, after one to many sessions wading through the archives, I feel it is
necessary to ask the question that has seemingly has never been answered!

I have a results page (not results.html before anyway asks) that has a CGI
variable passed into it. Which is then used to construct my search criteria
like so:

        [search-region more=1 search="
                                                    co=1
                                        op=em
                                                    sf=shop
                                        se=cookshop
                                                    op=em
                                                    sf=category
                                        se=[scratch current_category]
                                        ml=21"]

With me so far? Well anyway, what I would like to do on this page is give an
option to select from a drop down list options such as "Sort by price,
manufacturer" etc...etc. Kind of like what Amazon.com and others do.

Has anybody managed to do this? If so could someone please help!!!!!

All you need is a form on your results page, something like this:

<form action="[process]" method=post>
<input type=hidden name=mv_todo value=return>
<input type=hidden name=mv_nextpage value=@@MV_PAGE@@>
<select name=sort_field onChange="this.form.submit()">
[loop arg="category manufacturer price"]
        <option value="[loop-code]"
        [selected name=sort_field value="[loop-code]"]> Sort by [loop-code]
[/loop]
</select>
<input type=submit value="Sort">
</form>

...then just ad the sort_field to your search:

[search-region
        more=1
        search="
                co=1
                op=em
               sf=shop
                se=cookshop
               op=em
               sf=category
                se=[scratch current_category]
                tf=[value sort_field]
                [if value sort_field eq price]to=n[/if]
                ml=21"
]

Note that I kludged in numeric sorting for the price field only - the default sort type is alpha, I believe.

- Ed L.


_______________________________________________________________
«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»)
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
New Media E.M.S.              Technology Solutions for Business
463 Main St., Suite D         eCommerce | Consulting | Hosting
Placerville, CA  95667        suppressed
(530) 622-9421                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (530) 622-9426 Fax
_______________________________________________________________
«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»)
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.