Using the upgraded related records functionality in ver 3.71 (build 2656) but not able to get the Category Menu data from code generator

8 posts by 2 authors in: Forums > CMS Builder
Last Post: July 17   (RSS)

Hi Dave and Team,

I followed the post from https://interactivetools.com/forum/forum-posts.php?postNum=2247232#post2247232 regarding the updating/upgrading of the related records functionality:

"How to quickly try the new easier "Related Records" and "List Options from Database" features. If you've never done this before it's much easier now.

  • Create two new multi-record sections: Test Products, Test Categories
  • Add a few records in each, e.g., Product A, Product B, Product C, and Category A, Category B, Category C
  • Go to Database > "Test Products" and click "Add Field"
    • Set "Field Type" to List
    • Set "List Options" to: Get options from database (advanced)
    • Set "Section tablename" to: Test Categories
    • The values and labels columns should automatically select num and title
    • Some text should appear: "Recommended: Name this field test_categories_num"
    • Set "Field Name" to match the recommendation: test_categories_num (we're naming the field after the other table and field it refers to)
    • Save
  • Go to the "Test Products" menu, you should see a category pulldown that is loading it's values from the category menu.
    • Edit a record and set the category to "Category B"
    • Save
  • Next, go to Database > "Test Categories" and click "Add Field"
    • Set "Field Type" to Related Records
    • Set "Related Table" to Test Products
    • Save
  • Go to the "Test Categories" menu and click on "Category B" (or the category you choose for a product)
  • You should now see a list of all the associated products that have that category selected.

It worked as expected above, which is awesome; BUT when I attempt to use the code generator for building a category menu (screen shot 1) I am unable to choose any of the sections (categories or products) and generate the completed code (screen shot 2). I attempted to generate the category menu code on both the sections, but no bueno. 

Is this an incorrect use of the function?  I'd really like to learn how to generate category menus (bread crumb menus or unordered lists menus) from within CMSB.

Attachments:

ia_screen1.jpg 187K

ia_screen2.jpg 176K

Hi Codee, 

Try using the regular List and Detail code generators.

There's a special "Category Menu" type that can be created under: Database > Add > Advanced Menus > Category Menu, and it's used for hieratical parent/child category menus, but the demo is just referring to a regular multi-record section.  Sorry for any confusion!

Dave Edis - Senior Developer
interactivetools.com

Ok, Dave. I see.  So, I'm in the backend of cmsb, I choose database > add new editor > choose advance menus > category menu...then...what? 

Let's say I have an example similar to the one mentioned (as I'm learning to use this still)...and the sections are Test Equiptype, Test Categories, and Test Products (each has fields "title" and "graphic" upload).  Test Equiptype has 3 types of equipment, and then the equipment falls into categories under Test Categories A, B and/or C.  Then there are products, Test Products 1, 2 and/or 3, that are subcategoried under Test Categories - like so:

Test Equiptype

type1

type2

type3

>Test Categories

>Cat A

>Cat B

>Cat C

>>Test Products

>>Prod 1

>>Prod 2

>>Prod 3

How do I create a category menu that shows me the heirarchy with these 3 sections?

Thank you!

Hi Codee, 

You're trying to get the "Related Records" feature to work right?  If so, just ignore Category Menus.  We happened to use the same name "category", but it's a different feature.  You could essentially call your section "Test Groups" instead of categories for the purposes of our example.

Typically you'd have a related records field that shows you the "child records" of a particular record.  So you might have these sections:

  • Categories - Has a category name and a related records field showing products in this category
    • Product Types, has a category name (from a pulldown), a product name, and a related records field showing equipment of this type
      • Equipment has a name field, and product type (from a pulldown)

Does that make sense?  Let me know if we're talking about the same thing.

Dave Edis - Senior Developer
interactivetools.com

Hi Dave, Thank you for your patience and attention.  I "think" I am trying to do BOTH.  It started off with I have these 2 sections that have this hierarchy, and now added a third member to the hierarchy.  That seems to work well.  What I WANT is to have an ongoing breadcrumb-type menu that shows where we are at within that heirarchy...on the visual page.  Kind of like you use in these forums. Does that make sense? 

Here's where I am actually going with this as I do have an immediate need other than learning how to do this...

I just built a site, with cmsb ver 3.71, that I didn't use the related records fields with...but I can "see" that I probably could have, or should have.  The site is offering medical related training.  So, it provides a list of Courses that are being proffered.  Each Course has a group of Lessons within it.  Each Lesson has a group of Modules within it.  So the heirarchy here is: Course => Lessons=>Modules.  When someone is in Course 2, Lesson 5b, Module33 the breadcrumb menu should show similar to Home > Courses > Course 2 >Lessons (in that course)>Lesson 5b >Module 33 and maybe within Module 33 they are looking at a video or an option to download files.  

So, when I was reviewing the cmsb forums and the more recent related records improvements and also never used the category menu feature...I am thinking "Oh! That's what I need to do. I better learn this."  So I followed your well-written instructions on the related records with Test Products and Test Categories. It was really easy to do and I wish I had done that sooner, but already built the sections for Course, Lessons, Modules...but have no clue on how to make the breadcrumb or category menu and am trying to figure it out.

Zat help? or is it more muddied now?

Hi Codee, 

The "Category Menu" is best used for hierarchical data of the same type.  So if you have Courses > Lessons > Modules you'd have to have different fields for each (likely).

What I'd recommend is having 3 sections as follows: 

  • Courses
  • Lessons (with a pulldown for Course)
  • Modules (with a pulldown for Course and Lesson).  
    • For Lesson you could use "Get options from MySQL query" and "Advanced Filter: Refresh list when this field changes:"

If you want to fill out a 2nd level support ticket I can take a look for you and help you get it setup.  It's much quicker when we can take a look.

I'd get the back-end working well, and then think about the frontend, you can still create breadcrumbs with the above setup.  

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

Just so anyone following this post knows...I have confused several of the terms being used and am learning to understand the differences. I don't want to necessarily delete this thread because someone else might be a novice coder like me.  I have been instructed a bit more now and still learning. InteractiveTools has simply been amazing and a TREMENDOUS resource to me and my clients. Gratitude. Respect.