How To List Products In More Than One Section?

11 posts by 2 authors in: Forums > CMS Builder
Last Post: March 10, 2008   (RSS)

By rasbro - January 9, 2008

Is there a way to list products in more than one section, without creating a copy or duplicate? There are many instances where a product belongs to more than one category. For example, the client site I am developing with CMS Builder has Huckleberry products that belong to the category page of Gourmet Cabin Foods as well as Huckleberry Products.

Thanks for any help you can give me with this. This is an important feature that I didn't think to explore when I was researching CMS Builder.

Regards,
Brian

Re: [rasbro] How To List Products In More Than One Section?

By Dave - January 9, 2008

Hi Brian,

I don't know if I know exactly what you mean, but we love a challenge and I'm sure we can figure something out. :) A few questions:

What "section editors" do you have setup right now?

Are there many categories? Could you have checkboxes in the product editor for each category: "Huckleberry", "Gourmet Cabin Foods" and then only list matching products (that have a check) in the respective categories?

Another option, we have a feature in the next release (v1.07 - due for release in the next day or so) that lets you use values from one "section editor" as options for a list field if a different section editor. So if you can select a product from your product menu in a list field (pulldown) on another menu. I hope that makes sense.

Do you think either of those will work? If I'm totally off base here maybe let me know a little bit more about the site structure or how you want things displayed.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How To List Products In More Than One Section?

By rasbro - January 10, 2008

No problem Dave, just glad to have your support!

I have about 7 sections setup right now, but only 2-3 will feature some of the same products. Since I am listing products, the menu type is "multi". I can foresee the need for maybe a total of 12-15 sections when the site is complete.


Are there many categories? Could you have checkboxes in the product editor for each category: "Huckleberry", "Gourmet Cabin Foods" and then only list matching products (that have a check) in the respective categories?


This option sounds like a possibility. Let's discuss further. I am not sure what you mean by the other option.

Thanks,
Brian

Re: [rasbro] How To List Products In More Than One Section?

By Dave - January 10, 2008

So there's 12 sections and they each have products? Are the fields the same in each section?

Maybe it would be possible to have one section "Products" which checkboxes for the 12 categories that a product might belong to? So you might have a checkbox called 'isHuckleberry' that you'd check for Huckleberry products?

If you could do that, then you could have multiple list viewers, and have each one only show the products you wanted. So you might have huckleberryList.php and you'd add this option to only show huckleberry products:

$options['where'] = "isHuckleberry = '1'";

Let me know if you think that will do the trick. If not, we can always figure out another approach.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How To List Products In More Than One Section?

By rasbro - January 10, 2008

Yea, I think that might do the trick Dave. I not 100% clear on what you have suggested, but it sounds like a good option. If you think you understand what I need, and feel this is a good solution, then I trust you and am ready to proceed with instructions to try this out. Can we try it out with a simple test to make sure this is what I need before going to far into it?

Thanks,
Brian

Re: [rasbro] How To List Products In More Than One Section?

By Dave - January 10, 2008

If you have any links that showed what you want it to look like that could always help, but here's what I recommend:

Leave all your other Section Editors intact for now, create a new one called "All Products" with all the fields you need plus checkboxes for the different categories.

Enter a few different products, for some check multiple categories.

Create a "list viewer" and check that it's listing all the products. Then add this code with one of the category checkbox fieldnames you've created:

$options['where'] = "isHuckleberry = '1'";

Check and see if it's just listing products that are in that category.

Create a copy of the list viewer for each category and change the where fieldname in each so each one shows a specific category.

Does that make sense? If you think that will do what you want give it a try. Hopefully it won't take too long to give it a quick test.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How To List Products In More Than One Section?

By rasbro - February 18, 2008

I just made another attempt at doing what you suggested (sorry I didn't get back to you on my first attempt, since I got busy with another project).

It appears to work like you instructed. My only question now is whether or not I need to have all products added through an "All Products" section editor, or if I can still have the separate section editors for each product category. I can see a lot of advantages to having all products under one section editor but I also see a disadvantage with having a lot of products to manage all under one section. And is there an easy way to move all products from separate sections over to just the one?

Thanks,
Brian

Re: [rasbro] How To List Products In More Than One Section?

By Dave - February 18, 2008

It's true, there's advantages and disadvantages to both. So it really just depends on what's best for the project.

There's no easy way to migrate products from one section to another. The way to do it would be to use a tool like phpMyAdmin or something similar and write a custom MySql query to copy them over.

If you've entered a lot of data already email me directly (dave@interactivetools.com) and I'll see what I can do to help automate the process for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How To List Products In More Than One Section?

By rasbro - February 19, 2008

Okay Dave, I just sent you an email with the site details.

Thanks,
Brian

Re: [rasbro] How To List Products In More Than One Section?

By rasbro - March 7, 2008

Dave, you had once offered to help me move product records in MySQL from the separate sections they are listed in and put them in one section called "All Products". The more I work with CMS Builder and customize ways to handle product listings, the more it seems to me that having all products under one section is more advantageous than other options. Unless there is a future enhancement that will change how products and categories can be handled in CMS Builder, then I am ready to make this change on one of my sites.

Could you still do this? Please let me know what you need and if it is something we could do in the next few days.

Thanks,
Brian