Setting up categories, subcategories and records

6 posts by 3 authors in: Forums > CMS Builder
Last Post: August 16, 2011   (RSS)

By coliva - August 12, 2011

Hi CMS team,

What is the best way to set up my page structure in CMSB for a site that is 3 levels deep? And then how do I set up the category menu in order to create a nav menu?

Our site will consist of:

Level 1 - Product Category sections - (ie, Cheeses)
- Level 2 - Brand sections (ie, Kraft)
- Level 3 - Individual product pages

We would like the Product Category sections to list all the brands and their related product links. The Brand sections would list the individual product links, and we'd also like to include (at the top of the page) a brand image and brand description, managed by CMSB.

I created multi-record section editors for each of the product categories: Cheeses, Sauces, Olis & Vinegars. These editors includes the fields: title, content, brand image and category (list). I then created records for each of the brands under the respective categories.

I also created multi-record section editors for each of the brands. These editors include the fields: title, content, category (list), image (upload).

I created a category menu group with the correct site hierarchy, and specified these categories within each of the records created for the brands above.

I've searched through numerous posts on how to bring this all together but haven't found a simple answer. Could you please either point me to the correct post or lend some insight into how to correctly set up the structure and link the pages together? I would greatly appreciate it.

Thank you in advance!
Claudia

Re: [coliva] Setting up categories, subcategories and records

By Jason - August 15, 2011

Hi Claudia,

It sounds like you're off to a pretty good start.

To make sure I understand how you'd like to structure things, you want to have a list of product categories (ie, cheeses, sauces, etc). Each product category will have one or more brands associated with it. Finally, you'll have individual products that will be associated with both a brand and a product category.

Does that sound right?

If so, you can probably accomplish all of this by using only 3 sections. The problem with setting up different sections to handle different product types is that you'll need to have separate viewer pages to be able to handle them. If they all have the same fields, you can get away with just having one.

Start by create 1 section to have your list of categories, and 1 section to have your list of brands. In your brand section, you can have a drop down list (pull down or multi-value, depending on what you need) where you can associate a brand with 1 (or more) product categories. That way, when someone list selects a category, you'll be able to get a list of brands associated with that category.

Finally, in your products section, you can have 1 list to associate your product with a category, and 1 list to associate your product with a brand. The reason you would have both lists is so you can get a list of products either by category or by brand. This will also help if you have a brand that appears in more than 1 category.

Unless your product category section is going to have any sub levels, you probably don't even need to use a category section. If you do need to use a category section, here is a good post to help get you started with sub categories:

http://www.interactivetools.com/forum/gforum.cgi?post=77230

Here is another article with tips on using the records in 1 section to be a list of values in another section:
http://www.interactivetools.com/kb/article.php?Populate-a-list-field-from-another-section-15

Hope this helps get you started. Please let us know if you run into any problems
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Setting up categories, subcategories and records

By coliva - August 15, 2011

Thank you so much Jason. Yes, the structure is as you stated. I will try this solution out and let you know if I have any other questions.

Re: [coliva] Setting up categories, subcategories and records

By coliva - August 15, 2011

Hi Jason,

I'm working on nesting the list or records from my brandList viewer into my product_categoryDetail page, but wanted to know how to limit the list so that only the brands that pertain to the selected product category display. I'm sure it involves an IF statement and the values of the pulldown lists, but i'm not certain how to write this out. Could you help me here please?

The same would apply for nesting the list of records from my productsList viewer into my brandDetail page.

I read the post by Chris describing how to set up a categories list to show the records, but in my case i'm not using a category menu item but instead just the records lists.

Here's what my code looks like:

// load records
list($product_categoriesRecords, $product_categoriesMetaData) = getRecords(array(
'tableName' => 'product_categories',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));

list($brandsRecords, $brandsMetaData) = getRecords(array(
'tableName' => 'brands',
));

$product_categoriesRecord = @$product_categoriesRecords[0]; // get first record


And how I'm displaying the records:
<h1><?php echo $product_categoriesRecord['title'] ?></h1>

<?php foreach ($brandsRecords as $record): ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a><br/>
<?php endforeach ?>

Re: [coliva] Setting up categories, subcategories and records

By ross - August 16, 2011

Hi Coliva

Thanks for the update! Glad to hear you got that going. Keep us up to date with how you are making out. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/