We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26834
    • 22 Posts
    Okay, so I’ve read everything I can find on Wayfinder, and I just don’t get it. I think I must be stupid or something. I’ve been doing web design for ages, and yet this, it has me baffled.

    I want a simple menu. I want the parent item to be in a different format from the other items, and I want active links to be bold. I sort of thought I had the right idea, but now it appears that I didn’t. I’ve spent hours trying to get this to work, so I’ve finally admitted I need help.

    Basically all I want is to have a class name for the entire ul, a classname for the active li, and a classname for the parent li. How do I do this?

    I’ve experimented with wf.classes and chunks and parameters and all sorts but the more I do, the more confused I get. If anyone could help, or point me to a simple (I haven’t found the beginner’s wiki at all simple), it would be greatly appreciated.
      • 20413
      • 2,877 Posts
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 16183
        • 1,390 Posts
        Hi,

        Sorry for your frustrations!

        It normally helps if you can post the code you are using (I mean the template chunks, the structure of your menus, etc). This way, answers you receive will be very specific...

        cheers/k
          • 26834
          • 22 Posts
          I’ve read those, and found they explained the parameters etc. but not exactly how to use them.

          For instance, you do template things in the chunks, but how does wayfinder know what chunks are what? Is it because of their name?

          This is the snippet call. I’m not sure if I need a chunk anyway, because all I need is the class names. I think. I also want to add &parentClass I think, to be able to change the formatting of the parent item.

          [[Wayfinder? &startId=`51` &outerClass=`distleftnav' &hereClass='distleftnavactive']]


          Basically, all I want is a simple menu like this, that I can format simply, as detailed in my first post:

          Parent Item
          Child 1
          Child 2
          Child 3
          ...

          Thanks.
            • 16183
            • 1,390 Posts
            For instance, you do template things in the chunks, but how does wayfinder know what chunks are what? Is it because of their name?

            You have to tell Wayfinder the names of the template chunks that you are using for your menu. You do this in your Wayfinder call. e.g. using your example above


            [[Wayfinder? &startId=`51` &outerClass=`distleftnav` &hereClass=`distleftnavactive`]] &parentRowTpl=`NAME_OF_THE_PARENT_ROW_CHUNK`


            You need to make sure that you are using backticks to enclose the values you give your parameters in the Wayfinder call. Maybe it was just a typo but in your example WF call I notice you also have apostrophes and not backticks throughout.

            The contents of the template chunks themselves are used to structure your menu. Wayfinder will always need template chunks to construct your menus. It has 3 inbuilt templates in case you don’t define these. Two of these are always required.

            The first one, the outerTpl will be used to construct the outermost container of your menu - I like to think of this as the outermost <ul></ul> of my menu.

            The second template chunk always required is the rowTpl. If you don’t define yours Wayfinder will use its in-built one. I like to think of this as the <li></li> of my menus since this template is used to create the row/list items of the menus.

            For parent items, you have several choices. You can use the parentRowTpl for your parent items in conjunction with the parentClass

            I think Wayfinder by default will give active items in your menu the class "active". You can use CSS to style this class.

            The website of Wayfinder’s developer and the WF wiki both have sample template chunks. Modify these to your liking if you please.



            Parent Item - parentRowTpl and parentClass should take care of this
            Child 1- rowTpl should take care of these child documents
            Child 2
            Child 3


            &outerClass=`distleftnav`

            The above outerClass should give the outermost opening <ul> tag of your menu the class distleftnav like so

            <ul class="distleftnav">


            You can have CSS styles for this class as you wish. I assume you have a CSS style sheet associated with your website’s template (note: I don’t mean WF template chunks). Additionally, using CSS descendant selectors you can style the li and li a of your menus using this one ul class="distleftnav"

            Did you install modx with the sample content? If not, then try and do this on a local/test server. This way you will be able to see sample Wayfinder calls, chunks, etc.

            I am writing this in hurry so hope it makes sense. Since you have read the documentation already, some stuff should make sense, I think...

            cheers/k
              • 26834
              • 22 Posts
              Thank you!

              I understood all of that, and it clarified everything. I think it was just a case of understanding how to use what I’d read about!

              I didn’t even notice the backticks. How blind of me.

              I’ll try it out later and hopefully it’ll work.

              Thank you, very much!
                • 16183
                • 1,390 Posts
                Quote from: sg1psychopath at Dec 29, 2008, 12:24 PM


                I didn’t even notice the backticks. How blind of me.

                Believe you me...even the "pros" in this forum have missed this at one point or the other wink

                Glad I could help...

                /k
                  • 26834
                  • 22 Posts
                  I think things are going well! Apart from the fact it’s not doing things quite how I want them, but I think that can be remedied by a chunk. That’s a job for tomorrow though, I think I’ve confused myself quite enough for one day!
                    • 26834
                    • 22 Posts
                    I think I’m being stupid again.

                    I did have the whole menu up, although it was doing strange things with the active and the parent and so I’m trying to write a chunk to tell it exactly how to do it. I now have just the parent, with nothing else showing. I’m completely confused again. I’m also getting slightly fed up and want to be able to continue with the rest of the site.

                    My Wayfinder call:
                    [[Wayfinder? &startId=`51` &outerClass=`distleftnav` &parentRowTpl=`distleftnavparent` &innerTpl=`distleftnavinner`]


                    Parent chunk:
                    <ul id="distleftnav">
                        <li id="distleftnavparent"><a href="[+wf.link+]">[+wf.linktext+]</li>
                    </ul>


                    Inner chunk:
                    <li><a href="[+wf.link+]">[+wf.linktext+]</li>


                    Sorry for bugging you again.
                      • 20413
                      • 2,877 Posts
                      You miss a correct closing in your call ---> ]] not ]

                      Then u need a wrapper in your chunks:

                      <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>


                      See: http://wiki.modxcms.com/index.php/Wayfinder
                        @hawproductions | http://mrhaw.com/

                        Infograph: MODX Advanced Install in 7 steps:
                        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower