We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8527
    • 8 Posts
    Hello everyone,

    I am just starting to use MODx and during my development I came across a requirement I am hoping is supported already and I just don’t know where to look. I need to be able to hand the manager off to a customer and have them be able to edit/create/delete menus at their own desire with out knowing how to write any wayfinder code or editing any code. I understand how to use WayFinder to build menus, and set up a page so it can have multiple different menus etc and that’s great for me to do once but then every time there is a change I have to go into the code and set up WayFinder for the particular menu I want because of a menu order change, an item in the menu is added/removed, the customer decides they want to swap menus completely with each other, etc.

    My goal is to be able to build a website with MODx and hand it off to my customer to maintain/update and telling them they need to come to me to go into the code and tweak the WayFinder snippet call for every menu change is much less than desirable.

    How I would like for my menus to work in example is a user can create a menu named TopMenu that has Home, About Us, Contact us and then another named LeftMenu that contains Products, Order History, FooBar. The user could then edit each of those menus to add pages, external links, placeholders, images, rename/reorder items, etc. Then from a development side I just reference the menu by name as a chunk and the menu is inserted, or I can create a TV for all the pages of a template that lists available menus so the customer can assign a related menu to a particular page.

    Please let me know if anything like this exists or if it is something I would need to develop myself, which is fine if that’s the case. I just don’t want to rebuild the wheel out of ignorance.
      • 26401
      • 247 Posts
      I get it (I think)

      Wayfinder is good for creating one manu, but when you want to select what goes in, looks like you can’t use a template variable to check.

      so here’s what I’m thinking...
      you can use two instances of wayfinder that have the same parameter, except for the template and inside the template you can use a PHx conditional to include the item only if the TV is selected.

      You could also copy and modify wayfinder or create a script that feeds the documents IDs.

        • 8527
        • 8 Posts
        Let me try and make a use case to explain how I would like to have everything work.

        I build a site for a client and hand it off to them. This site has a TopMenu consisting of Home, About Us, Contact Us. Now the user decides they would like to change About Us to say Company Profile while maintaining the current link, then they also want to add a external link to www.modxcms.com after contact us. Then they also decide to set up a tutorials page and on the left they want to put a menu for resources they used. They can then go and define a resources menu and add the links they want to it. Finally they should be able to go to the tutorials page and say this page uses the resources menu for a left menu.

        That allows the customer to create as many menus as they want. They can also modify existing menus with out knowing that WayFinder even exists let alone how to use it.

        Having my menus work this way also makes it easier to set up and maintain permission based menu such as an Admin has Edit and view available in their menu but a stander user can only view. I can make a call to a AdminTopMenu instead of TopMenu if you’re logged in with admin rights to give you more options.
          • 3749
          • 24,544 Posts
          Interesting idea. Let me try to make the case for using Wayfinder as a tool to help you do what you want.

          Quote from: efarley at Feb 24, 2010, 12:02 PM

          Let me try and make a use case to explain how I would like to have everything work.

          I build a site for a client and hand it off to them. This site has a TopMenu consisting of Home, About Us, Contact Us. Now the user decides they would like to change About Us to say Company Profile while maintaining the current link, then they also want to add a external link to www.modxcms.com after contact us.

          If you’re using Wayfinder, the user just changes the Menu Title of the "About Us" page to "Company Profile" and creates a weblink to www.modxcms.com.


          Then they also decide to set up a tutorials page and on the left they want to put a menu for resources they used. They can then go and define a resources menu and add the links they want to it. Finally they should be able to go to the tutorials page and say this page uses the resources menu for a left menu.
          If the tutorials page template has a spot for a Wayfinder menu showing all children, all the user has to do it create the resources under the tutorials page (or put weblinks to them there). Admittedly, the user doesn’t have control over the placement and style of the menu, but you could let the user choose from several templates and set a TV for the menu style. Wayfinder is completely agnostic with respect to the placement and styling of the menu so your case here isn’t really a case against using Wayfinder.


          Having my menus work this way also makes it easier to set up and maintain permission based menu such as an Admin has Edit and view available in their menu but a stander user can only view. I can make a call to a AdminTopMenu instead of TopMenu if you’re logged in with admin rights to give you more options.
          It’s very easy to show a different Wayfinder menu to members of different user groups. One menu can use a Tpl chunk that presents the resource menu titles as links, another can show them as text.

          BTW, the permission system in Revolution is much more granular and separates view, list, and edit permissions so what you want would be automatic.

          I think I understand what you’re trying to do. IMO, It will be much more work than using Wayfinder and will need more user support and training. It does sound fun to build, however. smiley

          Since Wayfinder bases the menu on the site tree structure, users don’t need to know Wayfinder exists to change the menu. They just need to know how to reorganize the site tree and change the Menu Titles of resources. You could create a menu tool to edit the Menu Title and Show In Menu checkbox for all published documents and provide drag-and-drop reorganization of the resources tree (already there in Revolution). That would be really useful for a lot of people and maybe as much fun. wink

          I can see that there might, theoretically, be situations where you don’t want the menu to reflect the site tree in any way, but I suspect that in practice, that usually means that the site structure hasn’t been organized properly.

          just my $.02 smiley
            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
            • 8527
            • 8 Posts
            Thanks for the advice, I had a feeling most of the functionality I am seeking could be duplicated with WayFinder, I have an Ebook I’ve been going through but at over 100 pages it’s a bit wordy haha. So basically it sounds like the keys to making the most out of WayFinder is less in learning to set it up dynamically as I have been thinking and more in keeping a well structured and organized site tree. An all around good practice, assuming my customers are technical enough to understand the site tree.

            I think this may be a more intensive training requirement for my customers but it is acceptable as creating a efficient site tree will be a standard part of my training. I just hope those people who aren’t computer savvy can grasp it without too much of a struggle.
              • 3749
              • 24,544 Posts
              I agree. I think what you want is best built *around* Wayfinder, rather than instead of it. smiley
                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
                • 8527
                • 8 Posts
                Oh yeah totally, WayFinder is a great tool for laying out the menu and setting styles things like that, but I’m not convinced the site tree is the best source for menu items in sites with more than a handful of pages or use a large number of resources and external links. It shouldn’t be too difficult to build an admin interface dedicated to creating menus along with a snippet that returns a wayfinder snippet call using values you select in the menu builder (IE. startID, ID ranges, tpl, etc). Then any user capable of using an admin form can create custom wayfinder snippets with a simple call to my snippet with the name of the menu to use. So I’ll take a pass at building it when I have some time, just hoping someone else had done it already haha
                  • 3749
                  • 24,544 Posts
                  Absolutely, although my feeling is that the bigger and more complex the site, the more you need Wayfinder. On a large site, I sure wouldn’t want to redo the menus every time I add a resource.
                    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