We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36439
    • 6 Posts
    Hi guys,

    I'm trying to create a menu with dropline submenus that I got from Stu Nicholls' site using Wayfinder, however, I'm having a problem and I've been trying to figure it out but obviously I haven't yet!

    My Wayfinder call is:

    [[!Wayfinder? 	
         	&startId=`0`
            &outerTpl=`dropline_outer` 
    	&rowTpl=`dropline_row`
      	&innerTpl=`dropline_inner`
         	&outerRowTpl=`dropline_outerrow`
    	
    	&hereClass=`current_page_item`
    	&firstClass=``
    	&lastClass =`` 
         
         	&removeNewLines=`TRUE`
         ]]


    and the templates:

    dropline_outer
    <div class="dropMenu">
      <ul>
        [[+wf.wrapper]]
      </ul>
    </div>


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


    dropline_inner
    <div>
      <ul>
        [[+wf.wrapper]]
      </ul>
    </div>


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


    I have a menu with 5 menu items on the first level and one of those items contains 2 items.

    The problem I have is that the menu works correctly (or rather how I want it) when I'm in the page with the submenu items. Ie, I hover over the menu item and the 2 submenu items appear.

    This doesn't happen when I'm in any of the other pages. What am I doing wrong?


    Any help would be greatly appreciated!


    Theo
      • 33968
      • 863 Posts
      Best way is to check your HTML and see what is being output there. Remove this line to make your menu code easier to read:

      &removeNewLines=`TRUE`

      Also, without the [[+wf.classes]] placeholder you won't get &hereClass=`current_page_item` and any other classes showing up in your menu.
        • 36439
        • 6 Posts
        I have checked the HTML and basically, when I'm not on that page the two submenu items are missing.

        Here's the HTML from the page with the submenu items:

        <div class="dropMenu">
          <ul>
            <li>
              <a href="#url">home</a>
            </li>
            <li>
              <a href="photos/">photos</a>
            </li>
            <li>
              <a href="info/">info</a>
              <div>
                <ul>
                  <li>
                    <a href="weddingpackages.html">Wedding Packages</a>
                  </li>
                  <li>
                    <a href="test.html">test</a>
                  </li>
                </ul>
              </div>
            </li>
            <li>
              <a href="contact.html">contact</a>
            </li>
            <li>
              <a href="dvds/">DVD</a>
            </li>
          </ul>
        </div>
        


        and here's the HTML from another page:

        <div class="dropMenu">
          <ul>
            <li>
              <a href="#url">home</a>
            </li>
            <li>
              <a href="photos/">photos</a>
            </li>
            <li>
              <a href="info/">info</a>
            </li>
            <li>
              <a href="contact.html">contact</a>
            </li>
            <li>
              <a href="dvds/">DVD</a>
            </li>
          </ul>
        </div>
        
          • 22427
          • 793 Posts
          In your templates you should have
          <ul [[+wf.classes]]>
          and
          <li [[+wf.classes]]>

          Lucas wanted to write
          without the placeholder [ [+wf.classes] ] you won't get &hereClass=`current_page_item`
          But in the normal text a MODX tag will not be displayed (perhaps it is tried to be interpreted? Here I inserted blanks between the double brackets, of course they have to be left out.)
            • 33968
            • 863 Posts
            @ottogal: thanks for picking that up, I hadn't realised it had been stripped out.

            While it's natural behaviour for MODx it's going to cause confusion in the forums - I've filed that as a bug here: http://bugs.modx.com/issues/5600
              • 36439
              • 6 Posts
              Thanks for the suggestions, but the placeholder (or lack thereof) wasn't my issue. I had just removed it (along with other things) trying to find out what I'm doing wrong.

              The following gives me the same results. Ie, no submenus showing in the menu unless I'm already in the container page.

              [[!Wayfinder?   
                  &startId=`0`
                  &outerTpl=`dropline_outer` 
                  &rowTpl=`dropline_row`
                  &innerTpl=`dropline_inner`
                  &outerRowTpl=`dropline_outerrow`
                   ]]


              Am I doing something wrong or is there some sort of setting I should turn on/off?
                • 36439
                • 6 Posts
                Right... I'm completely and utterly confused now...

                I tried the exact same Chunks and Wayfinder call in another modx installation and the html is generated as expected. Ie I get all the submenus no matter on which page I am. Only difference being 2.1.1 vs 2.1.3 with the latter not working.

                  • 36439
                  • 6 Posts
                  Ok, after lots and lots of back and forth and the eventual re-installation of Modx from scratch, I found that there was a problem with Wayfinder's installation.

                  Uninstalling and re-installing it through Package Management fixed the problem. I guess I should've done that first before recreating the whole site from scratch!!!

                  Oh well, if anyone else gets any weird problems, try that first!