We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7804
    • 80 Posts
    Just curious as to how most people do this (assuming you code your own navigation snippets). I saw a post on ALA which looks like a fairly decent solution, but it could be a pain to maintain and it seems like there would be a better solution out there.

    Can you think of a way that MODx would provide better handling of this beyond using just PHP? (I’ve never used Wayfinder but I’m sure it has built-in support for this.)
      • 28107
      • 230 Posts
      wayfinder does have that - give’em a try wink
        CONIN Werbeagentur . Köln
        http://www.conin.de
        • 7804
        • 80 Posts
        Quote from: spackko at Apr 23, 2008, 12:45 PM

        wayfinder does have that - give’em a try wink

        i understand that, but for those of us who prefer coding our own menus...
          • 7231
          • 4,205 Posts
          I use wayfinder in the same way I would do it by hand. In both cases I use unordered <ul> lists to build the menu and css to style it. And in both cases I use the "active" class to set the current here state. Ironically I used the "active" class from before I started with MODx so it was very easy to make the transition.

          In most cases I can get away with the standard default output from wayfinder, which is a simple <ul> structure with the default classes (active, first, last). It is amazing how far you can go with this simple structure.

          As for the ALA article, this is exactly how Wayfinder does it (in theory, wayfinder does so much more). It is an interesting method but there are others that don’t need any php. For example you could specify a specific ID to use in the body tag tha call the here state based on the ID. This will not require any PHP since it is pure CSS. You could probably find a simple way to do it with javascript as well.

          I could imagine using a hand codded menu for sections that will never change in order to save a little on processing. grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]