We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22797
    • 134 Posts
    I want to be able to assign the hereClass to a menu item even though the pages don’t show up in the hierarchy under that menu item. For example, here’s a simplified version of my document structure:

    + Home
    + Academics
    + Admissions
    + Courses
    + People
    + About Us

    I want the "Academics" menu item to be assigned my hereClass when I’m in the Courses area and in the Admissions area. How do I do this?

    I don’t want to put Courses or Admissions inside of the Academics folder, so that option is out, but I do want ALL of the sub-documents within the Courses and Admissions folders to use Academics as the "you are here" menu item, even though technically it’s not under that hierarchy in the document structure.
      • 25663 MODX Staff
      • 12,272 Posts
      I don’t think it’s possible without a custom snippet at all. You might consider putting them in the heirarchy and then creating an additional weblink document to go out of the hierarchy.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 36805
        • 354 Posts
        As far as I know there is currently no snippet available that allows you to define a hierarchy other than the manager’s document tree. So without hacking Wayfinder/DropMenu or writing a snippet of your own I can’t see how to achieve this.
          • 22797
          • 134 Posts
          Quote from: rthrash at Jan 20, 2007, 11:32 AM

          You might consider putting them in the heirarchy and then creating an additional weblink document to go out of the hierarchy.

          I tried a couple of variations on this idea, but it seems I have to choose between 1. having the correct wayfinder menu item be selected and 2. having the url that I want (i.e. without the word "academics" in the url).

          One possible solution -- which would involve altering the Wayfinder code -- might be to create a Template Variable called MenuParent, set the default to @INHERIT and then set the value of MenuParent of the "Courses" folder to the ID of the "Academics" folder. Then I could change Wayfinder so that it uses the MenuParent TV if MenuParent != @INHERIT, otherwise, use the regular document structure.

          This is the kind of change that would be nice to implement at a core level, so that MenuParent was always available (not just as a template variable), with the default behavior of the snippet set to use the document structure unless the MenuParent value is specified.

          But before I go about changing the Wayfinder code, does anyone have any better ideas than this?