So, trying to use Contentbox after many years. I have a template I bought from WrapBootstrap and am trying to slide-n-dice into a Coldbox theme. (Docs on this are… insufficient. Just having to figure it all out. No real walkthrough.)
In the default, primary theme that Contentbox installs, as I tear through it I find this line:
<cfset menuData = cb.rootMenu( type=“data”, levels=“2” )>
This “rootMenu” is simpy based on what’s in the CMS. There is example code in the theme\xxx\views_header.cfm file to build out a menu… based on what rootMenu() returns.
But Contentbox allows you to build your OWN menus. Yay! So I did. Let’s call that menu “global”.
The only way to get to this menu, in code that I’ve found is menuService.findBySlug(‘global’).
The object returned by rootMenu() and the object returned by findBySlug() are NOT the same kind of thing. The code used in that _header file is based on how rootMenu returns, and does NOT work for findBySlug().
I have spent TWO FULL days trying to understand the different types of menu items, and how the submenus apply so I can build a renderer. I am NOT having fun anymore. Things just don’t quite work like I’d expect.
So, the QUESTION:
Is there either:
- a way to convert the findBySlug() return to match the rootMenu() return format
- any sample code to build out a menu (where your template has to be different than Contentbox default templates) that are based on findBySlug() style.
- a way to retrieve a custom menu in the format returned by cb.rootMenu()
Any help would be much appreciated. I’m about ready to give up on slicing and dicing an external template into Contentbox theme style so I can NOT build a bunch of custom code and use what Ortus has built.