We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13825
    • 55 Posts
    I have an issue where using friendly alias path results in the wrong url being created (I’m using wf 2).
    I’m using a drop down menu and showing the top 2 levels and basically if I’m on a top level page everythings fine but from a 2nd level page any other nav item I hover over has urls like:
    www.example.com/current-top-level/hover-links-parent/hover-link

    where what I actually want is just:

    www.example.com/hover-links-parent/hover-link

    It always puts the current level after the site url. so on the about us/people page if I want to see and event I hover over the event menu and get:

    www.example.com/about-us/events/event-name

    which obviously doesn’t exist.

    Any ideas how to fix this?

     [[Wayfinder? &outerTpl=`nav_outer`   &innerTpl=`nav_inner` &rowTpl=`nav_list_item`  &level=`2` &startId=`0`  &rowIdPrefix=`nav_` &parentClass=`parent` &firstClass=`first`]]

    • Place this immediately inside your HEAD tag:
      <base href="[(site_url)]"></base>


      WARNING: using a short closing tag will work, but triggers a very nasty IE6 error with many common javascript libraries, frameworks, and scripts
      NOTE: you can include the closing tag in a conditional comment for HTML 4.01-compliance.
        • 10313
        • 375 Posts
        That didn’t work for me. I have spent several hours today to find that bug in supposedly Wayfinder 2. I thought my .htaccess was wrong. But then I noticed that the links I have put with ditto via [~id~] worked fine.

        I fixed it by altering the default rowTpl for Wayfinder. Instead of [+wf.link+] I use [~[+wf.docid+]~]. Works great.

        Martin
        • I think something else must be wrong in your configuration or in your templates Martin; I use Wayfinder with alias path option on many sites and do not run into this problem.
            • 10313
            • 375 Posts
            Hmmm, that’s interesting. Fact is, it works with my fix. Without that fix, the HREFs from Wayfinder in my document all had the path part twice, then the file name, e.g.

            path1/path2/path1/path2/file.html

            The links generated by [~ ... ~] were correct: path1/path2/file.html

            Maybe it is because my modx is installed in a subdirectory and the domain is redirected to that subdir. Nevertheless it’s strange that some links were correct and some were not.

            Martin
              • 10313
              • 375 Posts
              It’s me again with the same problem. I’m going slightly mad about this. I have a different site than last time. My own workaround (look above) does not work for me any more.

              I’m using MODx 1.0.2 with Wayfinder 2.5 beta (because of it’s PHx-support).
              I’m using friendly URLs, works great, as long as I do not use friendly paths.

              Now, I want to go to the next level with friendly paths. I followed all instructions (base url etc), and my CSS-files are loaded, the start page looks good.

              But: My menu only works once. The path part is again doubled. Say, I am on the start page (alias is "start"):

              start
              -> section1
              -> section2
              --> 2a
              --> 2b

              When I now hover the menu (after I have used it once and clicked it), all URLs contain "/start" twice, wich results in e.g. "/start/start/section1.htm". When I click that, I receive the "page not found" page wich currently is the start page. When I NOW hover the menu, all links begin with three "/start"s. And so on.

              When I directly open a supbage like /start/section2/2a.htm, the whole part "/start/section2" will be multiplied.

              What can be wrong here?

              I know that friendly paths should work, I have got them running on a different site (even without my workaround from above).

              Many, many thanks in advance
              Martin
              • Have you set the base href before anything else in your template HEAD? That is the only proper solution to resolving this alias_path issue you are having IMO.
                  • 10313
                  • 375 Posts
                  Quote from: OpenGeek at Dec 04, 2009, 05:23 PM

                  Have you set the base href before anything else in your template HEAD?
                  Yes I have. Exactly like on the other site where friendly paths are working correctly. I find it rather strange that the "path part" of the url is multiplied with each klick.
                    • 16872
                    • 2 Posts
                    Quote from: OpenGeek at Dec 04, 2009, 05:23 PM

                    Have you set the base href before anything else in your template HEAD? That is the only proper solution to resolving this alias_path issue you are having IMO.

                    Thanks for that hint. Took me about half a day to figure it out because I did not read carefully enough the first time :S
                      • 5450
                      • 3 Posts
                      I’m having the same issue now. Has anybody found a fix for this error?