[ic] Bypassing the whole [more] system

Mike Heins interchange-users@icdevgroup.org
Mon Sep 30 22:54:16 2002


Quoting Grant (listbox@email.com):
> Thank you very much for your response.  Both of your ideas sound great, but
> I think I like the sound of the ActionMap better.  That way the different
> category pages (Page 1 | Page 2 | Page 3) have distinct pages names.  That
> way they will all be indexed by search engines.  If I understand the
> PageResolution directive correctly (and I may not) all the category pages
> would be called "category_page", which I think would end up with a lot of
> category pages and flypages not being indexed.
> 
> I looked through the ActionMap docs online and I'm a bit confused.  If
> "category" is in the URL like above, a certain action is executed which is
> usually defined by a Perl subroutine.  In your example above what would
> happen?  If a page called
> "http://foo.com/cgi-bin/bar/category/CategoryName/1.html" is requested, the
> URL gets rewritten as "http://foo.com/cgi-bin/bar/CategoryName/1.html" and
> the specified subroutine is run?

No. The action mapped to "category" gets run. It gets passed the path,
i.e. "CategoryName/1". It would have to decide how to treat that and
what to generate. It could just do some setup and display a page, or
just set some CGI stuff and mv_nextpage to have the normal ITL things
do it.

> Each of those HTML pages would be
> "imaginary" like the process page right?  The actual page that is displayed
> would be defined in the subroutine?  Is that all correct?  I think I'm
> missing something.

It's easy.

ActionMap  category <<EOR
sub {
	my $path = shift;
	my ($catname, $page) = split m:/:, $path;
	$CGI->{somespec} = $catname;
	$page--;
	$CGI->{starting_match} = $page * 9;
	$CGI->{mv_nextpage} = 'some_display_page';
	return;
}
EOR

> 
> What do you think about bypassing the [more] system in general?  Do you
> forsee any problems with doing something like that?
> 

Not if you mind your P's and Q's.

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

For a successful technology, reality must take precedence over public
relations, for Nature cannot be fooled. -- Dick Feynman