3 Replies Latest reply on May 17, 2009 4:32 AM by Purple Edge

    Dynamic tree menu - help

    The1Morph

      Hi! how can I make dynamic menues (database driven) like the ones generated with MX Tree Menu?? can I do this with tools from ADDT?? and how? - or do you know any other extension, widget or tool for DW that can do something similar with MX Tree Menu???

      Thx!

        • 1. Re: Dynamic tree menu - help
          Purple Edge

          I've just created a Spry Menu using a slightly modified version of CSS_Menu 2, the original CSS_Menu 2 started behaving very strangely with IE8, so I had to replace it! You have to call the functions manually, since the extension stopped working a couple of version of DW ago.

           

          www.thenorthernbeaches.com.au

           

          The code to call this is identical to the code used by css menu 2, but is actually simpler.

           

          I can't post Adobe's code, but I can post some tips if you want to try it?

          • 2. Re: Dynamic tree menu - help
            The1Morph Level 1

            I want to try it so, if you want, send me some info on the menu from your example... can you update the database and the menu will update itself? if you add a category in the database it will show in the nenu? how can I link the menu to a recordset in the database and how can I make it see the difference from category and subcategory... in other words... how can I make it a dynamic menu linked to a mysql database table similar in functionality with tree menu from Interakt? (a spry menu with this functions will be greate )

            Thx!

            Florin

            • 3. Re: Dynamic tree menu - help
              Purple Edge Level 1

              Play around with it, it is simpler than you think! Add a spry menu to a page with a css menu on it, see how it is structured, then make the changes to get the results you want. A Spry menu uses a UL/LI structure very similar to that generated by css_menu, you just need to add a class to the LI.

               

               

              //CSS Dynamic Menus required file
              require_once('includes/cssmenus2/gwb_Menu2.inc.php');
              //Begin Menu1
                $Menu1 = new MX_Menu2('MenuBar1');
                $Menu1->setQuery($rs_Menu1);
                $Menu1->setPK("MenuID");
                $Menu1->setFK("ParentID");
                $Menu1->setNameField("MenuLabel");
                $Menu1->setTitleField("Tip");
                //URL parameters
                $Menu1->setLinkField("Link");
                $Menu1->setTargetField("");
                // Layout
                $Menu1->setLevel(-1);
                $Menu1->setSkin("MenuBarVertical");  <---------
              //End Menu1

               

              body

              <?php  // Dynamic CSS Menu 
                echo $Menu1->render();
              ?>

               

              css_menu2.inc.php

               

                foreach($this->DBItems[$id] as $key=>$val){
                  $li_class = ' class="MenuBarItemSubmenu"';     <-----
                  //the efective row