We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25770
    • 5 Posts
    Just downloaded and installed MODx (well "just" as in 8+ hrs ago) and like what I see so far. I am running into a bit of a head scratcher though.

    I’ve built a JS script to modify the menu onload so rather than <li><a /></li> I have <li><a><span></span></a></li> or something similar.
    (The reason is I’m migrating a currently approved HTML/CSS skin and some of the functionality of the current menu requires tagged css buried inside the <a> tag.)

    It works fine when I’m logged into manager but it fails when I log out of manager.
    It also fails on Opera but I think that’s just a result of different DOM attributes being available or not between the browsers....thus I can eventually figure that out.
    But in an attempt to circumvent the "logging" and the "browser" issue I began to dig into the underlying code looking for the script which generates the menu’s html. I think I found it in manager/document.parser.class.inc.php on or about line 1621, but I’m hesitant to actually modify it yet per the comment of "easy modifications" listed in the CMS reviews and was hoping perhaps there was a simpler script which controls that html code. I didn’t find anything under the assets folder but I feel uncomfortable modifying the manager folder contents since I don’t want to modify the administration side at all.

    I thought about just making my own chunk w/ my own menu but it appears going that route would remove the functionality of controlling the menu display and content from w/in the CMS (unless I also scripted that interaction).

    I’m developing using Ubuntu 8.10, browsers: Firefox, Opera, Galeon, and am fairly familiar with basic to moderate php and javascript functionality. I don’t need anything programmed, I just need pointed in the right direction if someone might know which way that is.

    Thanks,
    RC
      • 3749
      • 24,544 Posts
      Virtually all non-trivial menus in MODx are created with the Wayfinder snippet, which is infinitely configurable. Wayfinder allows you to create your own templates for various parts of the menu and specify what kind of menu you want with the parameters in the Wayfinder call. It’s generally JS-friendly as well.

      http://wiki.modxcms.com/index.php/Wayfinder

      Definitely better than hacking the core code.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting