We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30564
    • 60 Posts
    Hi all,

    Maybe I’ve missed this but I don’t see any discussions about using the mootools accordion function with Wayfinder. Examples seem to be either script.aculo.us. or JQuery. Anyone able to contribute insights, pointers etc.? Seems daft to add yet another js library when the functionality appears in the ’default’.

    Regards
      • 25663 MODX Staff
      • 12,272 Posts
      MODx doesn’t limit what you can implement on the front end. Use Wayfinder and custom templates to output the right format then attach the mootools calls as needed.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 30564
        • 60 Posts
        Thanks for the prompt response. I’m also hoping for some guidance to avoid pitfalls etc., e.g. did that but what every you do don’t do this.... to accelerate the learning curve.

        Regards
        PS Am finding MODx very flexible. Hope to put up my first site in the wild & here in a few days
          • 30564
          • 60 Posts
          OK guess I’m missing the blindingly obvious. How do I get the toggle function to work on MODx ’containers’? To expand, if I have a menu structure such as :-

          Economics {container, but also link to a page}
          --------> Data
          -------->Analysis
          ... ...
          Metric {next container but also a link}

          then when I click the Economics section I see for a moment my expanded menu and then the economic page loads and the menu is back to closed. Do I need to create a non-link element {section header} in menu, and if so how {weblink doesn’t seem to do this}? Further looking forward how do I keep the status of the menu {what should be open, what closed} from page to page?

          Regards
          PS As I’ve been trawling the net on this I note that the discussions are almost all about single page not multi-page.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            The accordion javascript works on the page currently being viewed in the browser. Consider that you are requesting and receiving a different page than the one in which you "opened" the accordion. Perhaps you can take advantage of the "active" class that is given to the parent once you’ve gone to the new page to open the accordion?
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 30564
              • 60 Posts
              Yes a thought, look back up the tree to open that sub section, {there’s a parent snippet I recall} or use the page id or the variables available within MODX, rather than saving status to file or dare one say it cookie smiley

              However, this hunt has made me realise that I really don’t know embarrassed how to install a section header in Wayfinder menus; irrespective of toggling, just for presentation purposes.

              e.g.
              Home
              [Corporate]
              about us... ...
              [Projects]
              smoke grinding
              skyhooks
              ..
              ..


              Regards