We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11773
    • 54 Posts
    happyavocado Reply #1, 18 years ago
    Hi there

    I’m new to Modx, and am currently n the process of transferring my dreamweaver site to Modx, and still getting to grips with it...

    In my template, I have set up a chunk for my navigation. However, on each page, there is a <li id="current"> for the link for that particular page, which will obviously be different for each page as the current link will be different. This is then defined in my CSS to show the current tab link as standing out.

    Because of this, I can’t put my navigation as a chunk as the code will need to be different for each page to take into account the <li id="current"> bit. This is a pain as one of the reasons I want to use a CMS is so that I can update things like the navigation without having to do so on each individual page.

    Is there any way to achieve this?

    Many thanks in advance. smiley
      • 16183
      • 1,390 Posts
      First, welcome to modx... grin

      Second, yes, modx has a facility to automatically/dynamically build your menus for you - it’s a snippet called Wayfinder. Have a look at it. It is highly customisable and will allow you to design your menus the way you want. Did you install modx with the example content? If you did then you should already have Wayfinder installed. What Wayfinder does is basically output a list (li) of your documents in modx - it mirrors the document tree. You can customise what you want to appear in the menu and what you don’t want. You can control the sub-menus, levels to show, etc....OK

      For tutorial on usage, have a look at Wayfinder’s developer’s pages here: http://www.muddydogpaws.com/development.html
      Check the wiki here: http://wiki.modxcms.com/index.php/Wayfinder (this is for wayfinder 1.0 but still worth having a look at - the muddydogpaws has wayfinder 2 stuff)
      Wayfinder dedicated forum: http://modxcms.com/forums/index.php/board,182.0.html

      any questions, just hola...you’ll find this community very friendly grin
        • 11773
        • 54 Posts
        happyavocado Reply #3, 18 years ago
        Thanks very much for your reply - it’s really good to know that I can solve my problem. I’m really loving modx!

        I had a look at the resources but could only find info regarding dropdown type menus - does anyone know of any links/resources/examples that I can read that explain to me how to set Wayfinder to make the link for the active page to behave differently?

        Many thanks smiley
          • 16183
          • 1,390 Posts
          Hi again...

          see my post here in response to the similar question you posted there: http://modxcms.com/forums/index.php/topic,30032.msg182316.html#msg182316

          cheers/k
            • 27330
            • 884 Posts
              • 11773
              • 54 Posts
              happyavocado Reply #6, 18 years ago
              Thanks everyone for your input. i’m not quite there with Wayfinder, but in the midst of getting to grips with it. One thing I’m unsure of is how you structure your tree to make sure the correct documents, or web pages, are inculded in the menu. Do you have blank folders acting as parents for main web pages?
                • 3749
                • 24,544 Posts
                Quote from: happyavocado at Oct 28, 2008, 09:35 AM

                Thanks everyone for your input. i’m not quite there with Wayfinder, but in the midst of getting to grips with it. One thing I’m unsure of is how you structure your tree to make sure the correct documents, or web pages, are inculded in the menu. Do you have blank folders acting as parents for main web pages?

                I’ve converted a couple of DW sites to MODx and I definitely never want to go back. wink

                You’re right that Wayfinder bases the menu on the structure of your document tree. Wayfinder parameters determine things like the depth of the menu, whether empty folders show in the menu, etc. Generally, you create a tpl chunk that serves as a template for each of the menu’s elements and then use a parameter in the Wayfinder call that tells Wayfinder to use that chunk.

                I think the best reference for the tpl parameters is here: http://wiki.modxcms.com/index.php/Wayfinder

                For your first one, though, it’s not a bad idea to just duplicate one of the examples here: http://www.muddydogpaws.com/development/wayfinder/examples.html
                  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
                  • 16183
                  • 1,390 Posts
                  Quote from: happyavocado at Oct 28, 2008, 09:35 AM

                  Thanks everyone for your input. i’m not quite there with Wayfinder, but in the midst of getting to grips with it. One thing I’m unsure of is how you structure your tree to make sure the correct documents, or web pages, are inculded in the menu. Do you have blank folders acting as parents for main web pages?

                  In addition to what has been said...

                  You can determine which documents you want to appear in the menu by ticking the show in menu box when editing/creating a document. This is tacked just below the "menu title" field which you can see when in the "General" tab.

                  On the other hand, there are a couple of wayfinder parameters that you can use to include or exclude particular documents from the wayfinder output

                  How you organise your document tree determines whether a document appears in the menu as a main menu or a sub-menu. If a document is a folder/container and it has chidren (documents inside the folder), the container document will appear as a main menu and if you have told wayfinder to show its children, they will appear as sub-menus

                  Hope haven’t confused you further grin
                    • 11773
                    • 54 Posts
                    Thanks for all the answers! I’m almost there smiley