[ic] Foundation - auto prod_group and category fine tune.

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Wed Oct 31 12:09:28 2001


From: "Mike Heins" <mheins@redhat.com>
> Quoting music@labyrinth.net.au (music@labyrinth.net.au):
> > I am trying to make sense of the /templates/components/category_vertical
> > file in the Foundation demo 4.8.2
> > I believe this file is responsible for auto-creating the default
Foundation
> > category link list on the left side.
> >
> > The problem I am having is with a category that has the same name as
another
> > category in a different prod_group.
> >
> > Similar thread in the archives i.e.
> >
> > Cat - Food
> > Dog - Food
> >
> > Clicking on Food brings up the same list of items in either case.
> >
> > I know that this functionality can be easily added with a typical IC
search
> > query using a coordinated search but the code in this component that
> > automatically pulls in the categories and groups from the products file
and
> > creates the links is a little beyond me. How do I get the code below to
> > create category links that will only return items exclusive to a
category
> > within a prod_group. Something to do with [cat-exec bar_link]  ?
>
> By default, the link type is "simple", which is a simple search.
> You can put "prod_group=X, category=Y" in the "selector" field of
> the cat table and get that to happen.
>
> In fact, I think the 4.9 devel CVS has a pages/admin/layout_auto.html
> file which does that for you automatically. That may even work
> in 4.8.

Thanks! It certainly does work as far as creating the different search
queries for each link.

Unfortunately, as is also the case with the 4.8.2 version, it does not auto
generate a complete category list if the products.txt file has a duplicate
category name within a prod_group:

prod_group    category
Dog    food
Dog    collar
Cat    food
Cat     flea powder

The layout_auto.html routine will only create a leftside list as follows:

Dog
 food
 collar

Cat
 flea powder

The second 'food' category doesn't appear on the list.
I tried adding the missing duplicate category using the Design: Site Layout
page in the UI and then changing the 'field=column pairs' to include the
correct group:

category=food
prod_group=Cat (as in pussy)

but this changed the Dog food link to Cat food also.

I guess the next step is to clone a category using the table editor for
against the cat file. Can this simply be done by hand using vi or are there
other dependencies that necessitate the need to use the UI? Perhaps a clone
category facility would be good and, perhaps a numeric display along side
category names in the layout editor would make this task not so daunting!
;-)

I guess the answer for a very automated product file upload/cat listing is
to use all unique category names.

Cheers!
Simon B