We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25638
    • 15 Posts
    Does anyone have experience/knowledge using OpenCube in MODx? I’m a newbie and trying to get a tree menu that will correctly code in to WayFinder with UL/LI seems to be a daunting task. I used OpenCube in the past and they are good --- their new QuickMenu allows one to create any kind of horizontal/vertical/tree menu and it can be done with the traditional UL/LI or what they claim as DIV/ANCHOR new and better method.

    Is there a free treeview menu out there that especially works well with MODx? OpenCube is also pricey, although they have a nice visual editor which definitely speeds things up!
      • 4310
      • 2,310 Posts
      I did a js Tree menu a while ago, use the link in my signature to take a look.
        • 25638
        • 15 Posts
        David - really appreciate this and the simplicity is exactly what I was looking for!

        However, a problem and some questions:

        Problem: I followed your instructions exactly and the menu does not display. The site is at: http://learning-center.wyndryder.com. When you look at the source view, it appears the script has correctly interpreted everything it received from the database, but the "document.write(d);" is not resulting in anything being written to the web page.

        Question#1: How do I remove the title line (which I am doing independently - as you can see "Topics" above where the menu is inserted)? Do I simply remove or comment-out this line: d.add(0,-1,\’Your Menu\’);’; ?

        Question#2: How do I invoke open/close all nodes from my HTML?

        Question#3: I assume the CSS can be changed any way desired?

        Rob->
          • 4310
          • 2,310 Posts
          Rob,
          I can’t see why it doesn’t write the content to the div.
          It looks the same as on my site, I even changed my sandbox menu from furl’s to index.php?id=** and it still worked.
          Not sure what the problem could be.
            • 25638
            • 15 Posts
            David - I’ll have to debug, but I’m not sure how to debug it. Also - could you answer my questions, especially #1 and #2?
              • 25638
              • 15 Posts
              According to IE, there is an error on this line that is generated by dtree:

              d.add(0,-1,’Learning Center Topics’);d.add( 1 , 0 , ’WyndRyder’s Learning Center’, ’index.php?id=1’);

              IE says:

              Line: 151 (the above pasted line)
              Char: 64
              Error: Expected ’)’
              Code: 0
              URL: http://learning-center.wyndryder.com/modx/

              According to Firefox, there is no error but there is also no menu. The script output in to the rendered page:

              <script type="text/javascript">
              <!--
              d = new dTree(’d’);
              d.add(0,-1,’Learning Center Topics’);d.add( 1 , 0 , ’WyndRyder’s Learning Center’, ’index.php?id=1’);
              d.add( 6 , 0 , ’Budget Expert’, ’index.php?id=6’);
              d.add( 2 , 0 , ’Dolphin’, ’index.php?id=2’);
              d.add( 3 , 0 , ’MODx’, ’index.php?id=3’);
              d.add( 4 , 0 , ’SoundTrek’, ’index.php?id=4’);
              d.add( 5 , 0 , ’SWiSHmax’, ’index.php?id=5’);
              d.add( 7 , 0 , ’About’, ’index.php?id=7’);
              d.add( 8 , 6 , ’Budget Expert Documentation’, ’index.php?id=8’);
              d.add( 9 , 2 , ’Dolphin Tips & Tricks’, ’index.php?id=9’);
              d.add( 10 , 3 , ’MODx Tips & Tricks’, ’index.php?id=10’);
              d.add( 11 , 4 , ’SoundTrek Video Tutorials’, ’index.php?id=11’);
              d.add( 12 , 5 , ’SWiSHmax Previewer’, ’index.php?id=12’);
              d.add( 13 , 5 , ’SWiSHmax FLV Players’, ’index.php?id=13’);
              d.add( 14 , 5 , ’SWiSHmax Tips & Tricks’, ’index.php?id=14’);

              document.write(d);
              //-->
              </script>

              .....looks correct, but why is it not rendering on to the web page?

              When I remove the line altogether I get a different error:

              Parse error: syntax error, unexpected T_STRING in /home/rsmaui/public_html/learning-center/modx/manager/includes/document.parser.class.inc.php(770) : eval()’d code on line 7


              Rob->
                • 4310
                • 2,310 Posts
                Question#1: How do I remove the title line (which I am doing independently - as you can see "Topics" above where the menu is inserted)? Do I simply remove or comment-out this line: d.add(0,-1,\’Your Menu\’);’; ?
                I think you have to have the start node defined.
                Question#2: How do I invoke open/close all nodes from my HTML?
                Just change to this in the .js file :
                	this._io = open || true;