We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28100
    • 66 Posts
    I found this really cool and very simple jQuery script, have it set up in a html page and working with multiple submenus (fully expandable and collapsable):
    http://www.i-marco.nl/weblog/archive/2008/05/08/simple_jquery_accordion_menu__#body

    I’ve set it up on my (local) modx install and it just doesn’t work.  The templating is all OK, the <ul>tags each have their unique id’s, the classes required are all there too, the JS and CSS show in the head of the documents ... but the pages open with the menu fully expanded and it just doesn’t work - and that is a really sad thing. 

    The only thing I can point to at the moment, is perhaps a JS conflict but since I’m JS illiterate I wouldn’t even know where to go from here except off to find a new script to get this working.  But since it’s taken me nearly a week of solid hunting and trialing so far, I’m really no that keen about that option.

    Can someone take a look at it - or let me know what I can do to provide the info needed to troubleshoot and resolve this if it’s at all possible?

    Much appreciated!  smiley
      • 5091
      • 332 Posts
      I just implemented a Prototype Accordion to Modx this morning. It works fine however it doesn’t show up with the browser that I was still logged in at Manager ( I suspect it’s conflicting to QuickEdit. ). This maybe the case to you just in case you didn’t check it out from other browser. If you still don’t see it from other browser, then it maybe the jQuery conflict - the ’$’. You can change it with Jquery no conflict mode.

        • 28100
        • 66 Posts
          • 22390
          • 11 Posts
          Hi, Men, can yo post your chunks used to constrain this menu ? grin

          Please.. thnks
            • 28100
            • 66 Posts
            It’s pretty easy - it just requires a unique id and the class"menu" attached to it. If you want it ’collapsable’ you also add that class to it as well.

            OuterTpl
            <ul id="menu" class="menu collapsible">
            	[+wf.wrapper+]
            </ul>


            RowTpl
            <li [+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
            [+wf.wrapper+]</li>

            InnerRowTpl
            <li [+wf.classes+]><a href="[+wf.link+]">[+wf.linktext+]</a>
            	[+wf.wrapper+] 
            </li>

            InnerTpl
            [+wf.wrapper+]

            parentTpl
            <li [+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
            <ul id="doc_[+wf.docid+]" class="collapsible">[+wf.wrapper+] 
            </ul>
            </li>


            Or something like that - I’m not using it now because my menu was way to HUGE to have all items generated, but I did have it working.

            To get the unique id, in your parent template you can use "doc_[+wf.docid+]" as above or [+classes+]/[+classnames+] and include &levelClass in your WF snippet call. Some one might have a better way of assigning classnames to the <ul> than that - but using the doc_id worked OK.
              • 11678
              • 160 Posts
              spacefish; How would your wayfinder call look using the chunks above?
              Thanks
              HalD
                "Today’s headlines are nothing more than whispers of history"
                • 28100
                • 66 Posts
                At it’s most basic (anything after this is up to you) you’d do something like this:
                [[Wayfinder? &startId=`0` &level=`3`&outerTpl=`outerTpl`&rowTpl=`rowTpl`&innerTpl=`innerTpl` &innerRowTpl=`innerRowTpl`&parentTpl=`parentTpl`&jsTpl=`jsTpl`&cssTpl=`cssTpl`]]


                The important part of making this work is the assigning of the class="menu" per the templates above, and each <ul> has to have a unique id so using the doc_id seemed the easiest way to go.



                Hope that helps! smiley
                  • 11678
                  • 160 Posts
                  Thanks for the help. HalD
                    "Today’s headlines are nothing more than whispers of history"
                    • 11678
                    • 160 Posts
                    spacefish; If you get a chance could you look at my post at:http://modxcms.com/forums/index.php/topic,27629.0.html and see if you have any suggestions.
                    Thanks,
                    HalD
                      "Today’s headlines are nothing more than whispers of history"