[ic] Category Flypage

Mike Heins interchange-users@icdevgroup.org
Wed Sep 18 22:40:01 2002


Quoting Schuyler W Langdon (gorditos@hotmail.com):
> >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.

If you want to hack on the core code, it is on your head. 8-)
Personally, I would add that code to the "missing.html" page
and then bounce the person to an error page if the category
search didn't reveal anything.

If you are hacking on the core code and it is something which has
hard-coded field names, you will almost always be sorry. You have
limited yourself to one catalog per IC server, and have set up
multiple versions of IC to support.

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

Friends don't let friends use Outlook. -- Bob Blaylock