[ic] Too many "Product Groups?" / 50 Limit Problem

Rick Bragg lists at gmnet.net
Tue Mar 4 18:57:41 EST 2008


On Tue, 2008-03-04 at 09:47 -0800, L C wrote:
> Hello All,
>  
> I beg of you to be kind and exact because I'm such a
> nubie and not sure what I'm doing plus know next to
> nothing as far as Perl.
>  
> I am trying to create a separate page titled, "Shop by
> Category" which would populate all prod_groups and
> then list each category underneath it.  I am trying to
> do this using the Auto Populate function of the Layout
> Editor.
>  
> When I can get auto populate to work properly, I'm
> only getting a total of 50 Product Groups instead of
> the 80+ that I have.
>  
> I've found a few references to this on the board but
> need to know Exactly where to add ml => 10000 on the
> layout_auto page (if that's where the change even
> goes!).  I have tried so many different things to no
> avail.  I'm thinking it has something to do with these
> lines but I just can't seem to get anything to work
> correctly...
>  
>  my $selector = '';
>  my $selcode = '';
>  my %area_defaults = (
>   name => undef,
>   which_page => $CGI->{which_page} || 'all',
>   sort => '05',
>   sel => $CGI->{sel} || 'left',
>   display_type => 'name',
>  );
>  my %catmap;
>  my $narrow;
>  my $lt;
>  my $search_code;
>  if($CGI->{cat_type} eq 'simple') {
>   $lt = 'simple';
>   $selector = 'category=~CATEGORY~';
>   $search_code = '';
>  }
>  elsif($CGI->{cat_type} eq 'narrow') {
>   $narrow = 1;
>   $lt = 'simple';
>   $selector = <<EOF;
> category=~CATEGORY~
> prod_group=~PROD_GROUP~
>  
> 
> I was also thinking that maybe I need to use the
> complex seach but when I've tried writing the seach
> I've gotten disasterous results.
>  
> Again, please forgive me if this question has an
> obvious answer to you 'well-seasoned' veterans!
>  
> Blessings,
>  
> Lisa
>  
> I'm using 5.4.2 with mysql, if that information is important.
> 
> 
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users



A couple of things...
You might not need perl at all.  Also, you can use ml=none to show all
items, the ml=xxxx line goes inside the block where the search is.

Here is an example in a query tag.  Basically if you put the following
in a page called shop-by-category.html, it should show all your products
in a simple list organized by prod_group, then my category, then by
alphabet. there would be headers for the prod_group, and category.

I wrote this really quick without testing, so...  somebody correct me if
i am bogus!

[query
    type=list
    label=products
    prefix=products
    list_prefix=products_list
    table=products
    ml=none
    sql=|
     SELECT * FROM `products`
     WHERE `inactive` <> 1
     ORDER BY prod_group category description
|]
[products_list]

[products-change 1][condition][products-field prod_group][/condition]
  <h1>[products-data products prod_group]</h1>
[/products-change 1]

[products-change 2][condition][products-field category][/condition]
  <h2>[products-data products category]</h2>
[/products-change 2]

    <a href="[area [products-code]]"
    >[products-data products description]</a>

[/products_list]
[/query]


Also take a look at table-organize tag to make it look pretty.

rick





More information about the interchange-users mailing list