We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    Hello, I have a wayfinder snippet that contains two levels of menus.

    When I am in a parent menu item, the menu is generated correctly. However, when I am in a child menu, all of the top level menu items are generated as children of the current parent.

    So lets say I have:

    Main
    About Us
    ===News
    ===Blog
    Contact Us

    If I am in Main or any other top level menu, the menu entries come out like:

    Main.html
    AboutUs/
    AboutUs/News.html
    AboutUS/Blog.html
    ContactUs.html


    However, if I am in AboutUs/ or either of its children, the menu items come out like:

    AboutUs/Main.html
    AboutUs/AboutUs/
    AboutUs/AboutUs/News.html
    AboutUs/AboutUS/Blog.html
    AboutUs/ContactUs.html


    Any ideas why it might be doing this? I am using modx 2.2.0pl2 and wayfinder-2.3.3. My apologies if this has been asked and answered previously, I couldn't get a search to match.

    Thanks,

    Paul


    Here is my call:

    [[Wayfinder? &startId=`1` &outerTpl=`mainnav_outer` 
    &innerTpl=`mainnav_inner` &textOfLinks=`menutitle` 
    &parentClass=`dropdown` &parentRowTpl=`mmnav_parent`]]


    mainnav_outer:
    <nav>
    <div class="menu">
    <ul [[+wf.classes]]>[[+wf.wrapper]]</ul>
    </div>
    </nav>


    mainnav_inner:
    <ul>[[+wf.wrapper]]</ul>


    mmnav_parent:
    <li>
    <a class="dropdown" href="[[+wf.link]]">[[+wf.linktext]]</a>
    [[+wf.wrapper]]
    </li>
    
      • 19369
      • 1,098 Posts
      Do you have base path, .htaccess and Friendly URL set up correctly? It doesn't seem to be an issue with Wayfinder.

      BasePath:
      <base href="[[++site_url]]" />


      Basic .htaccess:
      RewriteEngine On
      RewriteBase /MyWebsiteFolder/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        • 22827
        • 129 Posts

        Ahem. I have done quite a few modx sites, and always had base href there without fully understanding why.

        This time it got dropped from the template without my noticing!

        Thanks, problem solved.