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 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

Hi Dave,

Understood. I have set up an admin acct for you and sending in a second level request per your recommendation.

Thank you kindly!

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.