We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16183
    • 1,390 Posts
    Back to you original question

    I’m trying to create a sub/side nav menu where it will include the parent container in the menu as well instead of just the container items.

    did you attempt to use the &displayStart parameter? This is used in conjunction with startItemTpl (WF has a default one if you don’t specify yours). This would enable you show services in the side menu together with its children.

    I hope I understood your original intentions. If not, please correct me.

    cheers/k
      • 34077 ☆ A M B ☆
      • 64 Posts
      I played with that a bit too but still had the same issue. The top item maintains that active class when on sub pages. Does that issue make sense? You’ll see if you go to the site and click on something else like makeup that both hair and makeup are highlighted/colored different as both show active where Hair I don’t want to be highlighted unless on that page.
        Jason Bird
        Twitter: @jasonabird @threeeyedbird
        • 16183
        • 1,390 Posts
        Quote from: Bird at Jun 24, 2009, 09:27 AM

        I played with that a bit too but still had the same issue. The top item maintains that active class when on sub pages. Does that issue make sense? You’ll see if you go to the site and click on something else like makeup that both hair and makeup are highlighted/colored different as both show active where Hair I don’t want to be highlighted unless on that page.

        Yes, it does make sense; that’s why I said this in my post above....

        Am I right to assume that "Makeup, Nails, Tanning.....etc...Spa Parties & Packages" are all child documents of services? If that is the case, then with the way you have the menu set up, Hair will always have the active class applied to it as long as its child docs are active. This is because, "active" is the default value of the &hereClass; This class is applied all the way up the tree to the current item and to each parent up the document tree.

        There are different ways to go about this. I assume you want that side-menu to have a title (i.e. something like Hair). Would it be OK if it was called services? If it can be called services, then I can show you how to work with displayStart using the document services as the starting point of the menu and also displaying it.

        Another option is not to use hereClass in the side-menu but to use hereTpl instead. This template will only be applied to the current/active document and not its children or parents. You can then use CSS to style the hereTpl.

        cheers/k
          • 34077 ☆ A M B ☆
          • 64 Posts
          Sorry, missed that one post before. The makeup, tanning, etc are child documents of services but the "services" page is also the hair page. The client wants when you click services to start on the hair page. The sidenav I don’t want a heading on it, but instead all the services offered with links to the pages.

          Using the hereTpl sounds like the best bet maybe. How do I go about doing that?
            Jason Bird
            Twitter: @jasonabird @threeeyedbird
            • 16183
            • 1,390 Posts
            Grab a copy of the WF e-book in my sig for explanations... (sorry gotta run) or have a look at an example here:

            http://www.muddydogpaws.com/development/wayfinder/parameters.html

            Does he want to specifically use the name hair in the side-menu? or can he have the name services used instead?

            EDIT: Was still thinking along the lines of displayStart but that won’t help you since the displayed start item being a parent of the items below it will still have "active" applied to it when one of its child docs are selected. So, I suggest to go the hereTpl way..

            cheers/k

              • 34077 ☆ A M B ☆
              • 64 Posts
              Thanks for the great book! As I was looking through thought I found the golden answer with &selfClass but when I apply that it does perfect except for Hair as that is a weblink to the parent container of services. I just tried the &hereTpl using the code below. 2 issues with it is that I still can’t get Hair to show selected and if on the bottom item it now adds an extra separator. Didn’t think this would be such a hard thing to do sad. Site has both &selfClass and &hereTpl applied for your viewing/helping pleasure.
              <li[+wf.classes+]><span class="menuhere"><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></span>[+wf.wrapper+]</li>
              <li class="sidenavbreak"></li>
                Jason Bird
                Twitter: @jasonabird @threeeyedbird
                • 16183
                • 1,390 Posts
                Bird,

                I suggest upgrading to WF 2.5 Beta. The "hack" you talked about is now native to it, like I said b4 (I think). In addition, it introduces new templates firstRowTpl, lastRowTpl, plus other cools stuff

                It’s here:
                http://modxcms.com/forums/index.php/topic,33904.0.html

                I think and selfClass in version 2.5 can be applied to a weblink (not sure though).

                if on the bottom item it now adds an extra separator

                That can be handled by lastRowTpl in WF 2.5 beta...

                cheers/k
                  • 34077 ☆ A M B ☆
                  • 64 Posts
                  I think we got it With 2.5 installed now I can have a weblink as the parent container that stays active even when in a child element. Then using the &selfClass add a span to highlight the current page. I’m not using &hereTpl as when you use that it seems to ignore &lastItemTpl if the last item is active/here and thus adds the extra break. Moving documents around but I think I have it. Thanks for all the great help!

                  Anything I should be concerned with for the 2.5 beta?
                    Jason Bird
                    Twitter: @jasonabird @threeeyedbird
                    • 16183
                    • 1,390 Posts
                    Glad u got it sorted laugh

                    Anything I should be concerned with for the 2.5 beta?

                    Hmm, don’t know for certain but I doubt...but you you never know with bugs...

                    Nice site u got there, btw smiley

                    cheers/k
                      • 34077 ☆ A M B ☆
                      • 64 Posts
                      Thanks! The only thing is at first I replaced my old wayfinder system with it and then discovered the snippit is looking for wayfinder2.5 as the folder name. Could trip up some tongue. Thanks again for your help and great work.
                        Jason Bird
                        Twitter: @jasonabird @threeeyedbird