[ic] Overriding scan with ActionMap

Mike Heins mike at perusion.com
Fri Oct 17 17:53:04 EDT 2003


Quoting Chris Wenham (cwenham at synesmedia.com):
> 
>  I'd like to override the "scan" action with an ActionMap, but only so I can 
> change mv_nextpage and mv_search_page and leave everything else intact. But 
> what I've got isn't running the search, so there aren't any results.

It won't run a search exactly like scan unless you emulate the whole
action as provided. Instead of $Tag->update('process'), you should
do &Vend::Dispatch::do_scan.

These types of URL and variable modifications are really more properly
done in an Autoload.

> # Store specific search results
> ActionMap  scan   <<EOR
> sub {
> 	if ($::Variable->{STORE} =~ /tapestry/) {
> 		$CGI->{mv_nextpage} = 'tapestry_results';
> 	}
> 	$Tag->update('process');
> 	return 1;
> }
> EOR
> 
>  I've also been trying to find the documentation for ActionMap that tells me 
> how Interchange responds to an ActionMap's return value. What's the 
> difference between returning 0, 1, a string, etc?
> 

There is only true and non-true. If it is true, IC runs the page as
normal based on mv_nextpage. If it is false, then it assumes you have
done any necessary output and doesn't do anything with mv_nextpage.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike at perusion.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer


More information about the interchange-users mailing list