[ic] Category Flypage

Schuyler W Langdon interchange-users@icdevgroup.org
Wed Sep 18 22:13:00 2002


>Mike Heins wrote:
> Quoting Stefan Hornburg (Racke) (racke@linuxia.de):
> > Schuyler W Langdon writes:
> >
> > > The catalog tutorial states, "Interchange will check and see if the
> > > requested page has the same name as a product ID from the product
database
> > > table. Interchange then creates a product page "on the fly" using
> > > pages/flypage.html." I'm looking to modify this functionality so that
it
> > > will additionally check the category table, and if a match is found --
> > > generate a page on the fly but with a different page. Could anyone
tell me
> > > what module(s) controls this particular functionality?
> >
> > It is the routine fly_page in Interpolate.pm.
>
> I don't think that is really what he needs -- I would search for
> "PageSelectField" at www.icdevgroup.org....
>

Thanks for the information. I was able to hack Page.pm a little to allow a
category name to be the page in a url (as can be done with the product
keys). I added this to display_page after it checks Interpolate::fly_page:

if(! defined $page){
  my $cat_search = Vend::Data::database_field("cat",$name,"search","name");
#::logDebug("cat search is: $cat_search");
  if($cat_search){
   $cat_search =~ s/\r*\n/\//g;
   do_scan($cat_search);
   $page = readin("results");
  }
 }

This is really the same as the category search and there has to be a search
specified in the cat table. For the cat menu items to show up in the
category template components as the category name url, the link type had to
be changed to interchange page and the page field set to the cat name (a
page doesn't really exist). This is tricky with the UI Display wizard, I had
to use the table editor.

--
Schuyler Langdon
GatorDev