[ic] question about [value ...] , [cgi ....]

Jon interchange-users@icdevgroup.org
Wed Feb 5 22:58:00 2003


> > > I am trying to get the value of mv_search_file after
> clicking a
> > > area search link in category_horizontal. Nothing was added
> to
> > > the category_horizontal file but just this:
> > >
> > > [value mv_category_horizontal] <--- didn't work.
> > >
> > > then I went throught the milling list and found something
> about
> > > [cgi ..] so i added this
> > >
> > > [cgi mv_category_horizontal] <---- didn't work.
> > > [cgi fi] <--- event tried that.. didn't work.
> > >
> > > then I went to the milling list again ..
> > > and this time
> > > [perl]
> > > my $name = $CGI->{fi}
> > > return $name
> > > [/perl]          <---- didn't work.
> > >
> > > I am trying to keep track of which product cat (area) the
> user
> > > is on and print out something base on that. Thanks for any
> help!
> >
> >     This may or may not be what you're looking for. I was
> fortunate
> > enough
> > to get this from Jeff at shop.sophee.com, I hope he doesn't
> mind me
> > reposting it, and I would send you to the archives but the
> thread
> > doesn't
> > appear to be there yet.  In any case this will grab the info
> from the
> > user's
> > click on something in category_vertical.  If this isn't what
> you're
> > looking
> > for then maybe ask again.
> >
> > Jon
> >
> >
> >
> > [if session last_search =~ /products/]
> >    [seti lastsearch][data session last_search][/seti]
> >    [perl]
> >      my @sf;
> >      my @se;
> >      my $item;
> >      my $cnt = 0;
> >      my $tmpSearch = {};
> >      my @searchstring = split(/\//,$Scratch->{lastsearch});
> >      ## build list of sf and se
> >      foreach $item (@searchstring) {
> >        if ($item =~ /^sf=(.*)/) {
> >          push @sf,$1;
> >        }
> >        elsif ($item =~ /^se=(.*)/) {
> >          push @se,$1;
> >        }
> >      }
> >      ## now build our hash of field/term pairs
> >      foreach $item (@sf) {
> >        $tmpSearch->{$item} = $se[$cnt];
> >        $cnt++;
> >      }
> >      ## populate needed scratch values
> >      $Scratch->{lastbrand} = $tmpSearch->{brand};
> >      $Scratch->{lastmaincat} = $tmpSearch->{maincat};
> >      $Scratch->{lastsubcat} = $tmpSearch->{subcat};
> >      return;
> >    [/perl]
> >  [/if]
>
> Thanks for the code! It helps a lot. A
> nd I got it working with the help of this "[if session
> last_search =~ /products/], [seti lastsearch][data session
> last_search][/seti]
> "
> But why couldn't I get the value of mv_search_file by [value or
> cgi mv_search_file]? Right now, I get the value from [data
> session last_search] which has all the search args.
>
> I through the reference guide but couldn't find anything about
> [data session ...]. Maybe i miss something.... anyway what does
> it mean or do? thanks for any help!
>
> Thanks again Jon
>

    First of all thank Jeff not me because that isn't my code, however,
I was able to modify the above to do what I wanted.  Thanks Jeff.
Unfortunately I don't understand IC enough to really answer what you're
asking.  And I couldn't find any reference to 'session last_search'
in the documents either.  There is however are references to the data
and cgi tags.
Look at them to understand a bit about them.  I believe you can't get
mv_search_file
via cgi because it isn't a normal cgi parm, but I could be way off
there.  And you
can get some of the mv_ values from scratch because I believe some prior
code
has put them in scratch and hence not everything is in scratch.  One
thing I
use at times is  [dump scratch] and search through that via the browser.

A bit clumsy but it has turned on some light bulbs for me.  I'll agree
with you
though that knowing about  'session last_search' was a significant piece
of
the puzzle.

Jon