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

    Okay, I figured since this doesn’t look to be a quickfix extension of the other similar thread here, I’d start from scratch, with pretty pictures to boot. smiley

    So I’m building a CMS at work here that will be used mainly as a place to display internal information for the time being. The institution I work at has pretty strict style/branding guidelines, so I’m reworking the MODx templates to meet those guidelines (Meaning I have to get it working the way it is now. wink )

    The primary navigation for the site is a menu on the left-hand side, which consists of several sections, each with a static heading, and a list of links underneath it. When one of those links is clicked, if that page has any children pages attached to it, when the page loads, those children pages will be subsequently displayed in the menu.

    To allow the content editors full access to the menu structure (and to try and prevent manually hardcoding content), I’ve set this up as a 3 tier menu system in MODx.... which I then hope to put into my templates with Wayfinder. smiley
    In the MODx manager, this is set up as 3 tier collection of resources, with the highest level pages serving as the section header, and the second level set of pages serving as the main set of links (Which can then optionally have child pages attached to).

    Sooo... the problem here is that I’m not exactly sure how to go about doing this. I was originally hoping this would be as simple as appending &hideSubMenus to the Wayfinder call, but that then hides both tiers 2 and 3, which is not what I want. I also tried nesting Wayfinder calls coupled with ’[[UltimateParent]]’, but that doesn’t seem to work on this kind of menu structure. huh

    Does anyone know of any other way this could be achieved?

    Thanks! grin
      • 16183
      • 1,390 Posts
      TiM,

      Is javascript an option? a jQuery Accordion menu could easily accomplish what you want, I think..Coz, the tricky bit is hiding the 3rd tier until the 2nd tier parent item (link) is clicked. I think even some CSS trickery can achieve this...I have to think about it....maybe even WF alone can do this...

      cheers/k
        • 14
        • 9 Posts
        Hey again kongondo.

        Hmm, yeah, JavaScript is an option, but I’m hoping not to. The links shouldn’t be getting loaded/displayed unless the user is currently on that tier 2 page or any of its tier 3 children. undecided

        I probably could just use some CSS and/or JavaScript hackery to hide all of the tier 3 links them until such time, but I don’t really like the practice of generating, then hiding code... trying to avoid that hehe. laugh

        -TiM
          • 16183
          • 1,390 Posts
          <random>OK, brainstorming here...random thoughts, not well thought out...</random>

          Do the static headings - overview, navmenu test, blog, etc have to be MODx resources? What if they were not and those headings came from some other MODx field, e.g. description or long title or some TV? Then that would mean that in reality you will only have a 2 tier menu but the output will look like a 3 tier menu...hmmm.. The tricky bit will be to insert the headings in the correct places within the WF tpl chunks...hmm...

          cheers/k
            • 16183
            • 1,390 Posts
            Quote from: -TiM- at Sep 03, 2009, 09:19 PM

            The links shouldn’t be getting loaded/displayed unless the user is currently on that tier 2 page or any of its tier 3 children. undecided

            -TiM

            Does that apply only to tier 3 or even tier 2? I mean, if tier 1 is all static (so not clickable, right?), then how do you make tier 2 visible? Aren’t tier 2 set of links visible all the time? i.e. tier 2 visible always, and tier 3 visible when tier 2 parent active?

            cheers/k
              • 16183
              • 1,390 Posts
              And...will all the static headings have the 2nd tier set of links? For instance, in your screens above, "overview" doesn’t seem to have any links below it. Will this be the case?

              cheers/k
                • 14
                • 9 Posts
                Quote from: kongondo at Sep 03, 2009, 09:21 PM

                Do the static headings - overview, navmenu test, blog, etc have to be MODx resources? What if they were not and those headings came from some other MODx field, e.g. description or long title or some TV? Then that would mean that in reality you will only have a 2 tier menu but the output will look like a 3 tier menu...hmmm.. The tricky bit will be to insert the headings in the correct places within the WF tpl chunks...hmm...

                Hmmmmmmm..... I suppose not. Odds are the tier 1 menu names won’t be changed all that often. If that’s the case, it probably might be possible to just make the headings a static chunk and then add a Wayfinder call for each menu section referencing startID manually. Again, it takes a bit of control away from the content editors, but it might not be helped if there’s nothing else. :’(

                Quote from: kongondo

                Does that apply only to tier 3 or even tier 2? I mean, if tier 1 is all static (so not clickable, right?), then how do you make tier 2 visible? Aren’t tier 2 set of links visible all the time? i.e. tier 2 visible always, and tier 3 visible when tier 2 parent active?

                Yeah, all the tier 2 entries are visible all the time. (Since tier 1 technically doesn’t count as part of the nav, tier 2 are the main menu links). Ideally, the tier 3 links for any tier 2 menu entry would only be visible on the tier 2 page itself, and any tier 3 children from that page.


                And...will all the static headings have the 2nd tier set of links? For instance, in your screens above, "overview" doesn’t seem to have any links below it. Will this be the case?

                Oh no no. Those are just links that came with the default install of MODx. I just haven’t cleaned them up yet. laugh
                But in the final version, each Tier 1 section will be expected to have one or more tier 2 menu entries in it.

                Thanks for your help. smiley

                -TiM
                  • 16183
                  • 1,390 Posts
                  OK,

                  Lemme sleep on this one...

                  cheers/k
                    • 14
                    • 9 Posts
                    Hmmm, well I managed to get the requirements for this menu thing changed slightly, and ended up doing it manually.

                    So it turns out the Tier 1 menu entries will rarely (if ever) get modified, so I turned them into a chunk. And then from there, I added a Wayfinder call to each Tier 1 entry in the chunk, manually referencing the ID of the nav section from the manager as well as adding the hidesubmenus parameter.

                    It’s not the most perfect solution (because it still potentially requires manual HTML editing), but it’s more than acceptable for my menu here. smiley

                    One thing I’m wondering though is if I can make a suggestion for Wayfinder. In addition to the ’hidesubmenus’, argument, would it be possible to add maybe a submenu level limit? So that way if the navigation is more than 2 levels, you can set the level to display by default.

                    -TiM
                      • 16183
                      • 1,390 Posts
                      TiM,

                      Sorry I’ve been very busy (I still am wink) and haven’t had a chance to look at this. Anyway, glad you solved it. Do you mind posting your solution here to help others? As for the request, you can contact the developer here http://www.muddydogpaws.com/ and see what he says.

                      cheers/k