[ic] change displayed URL of results page

Kevin Walsh kevin at cursor.biz
Thu Dec 21 20:15:05 EST 2006


"Daniel Davenport" <DDavenport at newagedigital.com> wrote:
> > Is there anyway to change the URL of a results page from 
> > something like:
> > 
> > http://domain.com/scan/se=AA/sf=category/st=db/sp=results/tf=s
> > ku/ml=20.html
> > 
> > to something like:
> > 
> > http://domain.com/somethingelse.html ?
> > 
> > Is this possible with any IC and/or Apache tricks?
> > 
> [snip]
>
> ActionMaps are a bit more involved.  The /scan/... urls are actually
> done via an action map (internal to IC?), so of course it's possible to
> do your own action that works like /scan.  But since you'd be pretty
> much taking over the job that /scan does, you'll likely need to set a
> lot of the cgi and search variables yourself (unless someone else knows
> of an easier way...).
> 
It's not too involved.  You could use something like the following:

    ActionMap cat <<EOA
    sub {
        my $cat = shift;
        $cat =~ s:^cat/+::i;

        $CGI->{mv_searchtype} = 'db';
        $CGI->{mv_search_field} = 'category';
        $CGI->{mv_searchspec} = $cat;
        $CGI->{mv_sort_field} = 'sku';
        $CGI->{mv_matchlimit} = 20;

        $CGI->{mv_todo} = 'search';
        $Tag->update('process');

        return 1;
    }
    EOA

Using the above local ActionMap example, you could search for all products
in the "AA" category using a URI like "http://www.example.com/cat/AA.html".

Substitute "AA" for "foobar", or whatever you'd like to look for in the
"products.category" column.

See also:

    http://www.interchange.rtfm.info/icdocs/config/ActionMap.html
    http://www.interchange.rtfm.info/icdocs/Search_parameters.html

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/


More information about the interchange-users mailing list