We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 167
    • 10 Posts
    hey all, long time lurker...finally broke down and tossed MODx on the server to have a play. Must say this is my fave CMS to date; bang up job to all involved. However, I’m just having a heck of a time getting used to the whole snippet/tv/chunk schema (it will come with time i’m sure)...anyway, I was wondering what exactly needs to be done to mimic a menu system like found on this site:

    http://hovie.com/

    Pretty straight forward from a pure ul/li/css standpoint, but I don’t know where to begin on doing this in MODx (aside from making way too many templates...which kinda defeats the point). From what I gather, the ultimateparent snippet needs to be used as well...but I’m not finding much clear cut info on how exactly you would implement it.

    Any insight would be stellar smiley
      • 32319
      • 129 Posts
      For the first menu, use a call that looks something like this:
      [tt][!Wayfinder? &selfClass=`nav_here` &startId=`[[UltimateParent? &topLevel=`1`]]` &level=`1` &outerTpl=`WAYFINDER_subnav_outerTpl` &rowTpl=`WAYFINDER_rowTpl`!][/tt]

      For the second use a call like this:
      [tt][!Wayfinder? &selfClass=`nav_here` &startId=`[[UltimateParent? &topLevel=`2`]]` &level=`1` &outerTpl=`WAYFINDER_subnav_outerTpl` &rowTpl=`WAYFINDER_rowTpl`!][/tt]

      You may need to play around with the variables to get exactly what you want but this is the general idea.

      Notice that the Wayfinder call is un-cached "[!!]" and the UltimateParent call is cached "[[]]" this is required for the snippet call to function in version .96 or earlier (should be fixed in .97).
        "Regret for the things we did can be tempered by time; it is regret for the things we did not do that is inconsolable."
        -- Sydney Harris
        • 167
        • 10 Posts
        thanks for the reply, i will try that out laugh
          • 167
          • 10 Posts
          ok, so I’ve gotten it to work...sort of.

          the only way I was able to get that method to work, was to create an unpublished document with the main menu pages as children, and their sub menus as children. For some reason, I just couldn’t get it to display the main navigation entries when their parent was 0. While the method I’m doing right now technically works...it isn’t ideal since it makes the friendly URLs not so friendly undecided
            • 167
            • 10 Posts
            anyone have any ideas?

            I’m using Whitefen’s method exactly; and while it is functional if I do said steps above...its really rather ugly in the address bar.
              • 167
              • 10 Posts
              actually, nevermind...got it. Turns out that I needed to only use ultimate parent for the child menu, not the main menu...so it looked something like this:

              Main Menu:

              [!Wayfinder? &selfClass=`nav_here` &startId=`0` &level=`1` &outerTpl=`WAYFINDER_subnav_outerTpl` &outerClass=’main_nav’ &rowTpl=`WAYFINDER_rowTpl`!]

              Child Menu:

              [!Wayfinder? &selfClass=`nav_here` &startId=`[[UltimateParent? &topLevel=`1`]]` &level=`1` &outerTpl=`WAYFINDER_subnav_outerTpl` &rowTpl=`WAYFINDER_rowTpl`!]

              and I did two templates...one for main menu and one for child menu where the only difference was the inclusion of the &outerClass. That was so that I could style the active links. There is probably a better/easier way to go about that; but it was the best I could come up with lipsrsealed
                • 10315
                • 4 Posts
                disregard
                  • 10315
                  • 4 Posts
                  disregard