We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10525
    • 247 Posts
    modx 2.2.14
    wayfinder 2.3.3
    Using friendly URLs

    I have an issue with the first menu item link in Wayfinder always being an absolute URL, and not including the page title, for the first page (id 1).

    This modx installation happens to be in a subdirectory ("subdir") of the domain root, but works fine aside from this issue.

    My base path:
    <base href="http://mydomain.com/subdir/" />


    My Wayfinder call:
    [[!Wayfinder? &startId=`0` &outerTpl=`outerTpl` &rowTpl=`rowTpl` ]]


    My rowTpl:
    <div class="[[+wf.classnames]]">
        <a [[+wf.id]][[+wf.classes]] href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
    </div>


    My menu:
    <div id="mainMenu">
      <div class="item first">
        <a  class="first" href="http://mydomain.com/subdir/">HOME</a>
      </div>
      <div class="item active">
        <a  class="active" href="about/">ABOUT</a>
      </div>
      <div class="item ">
        <a  href="findus/">FIND US</a>
      </div>
      <div class="item last">
        <a class="last" href="contactus/">CONTACT US</a>
      </div>
    </div>

    As you can see, the first page is linked by an absolute URL which does not include the page title ("home"). All of the other links are relative and work fine in conjunction with the base path.

    I don't mind whether the first link is absolute or relative, I just want it to include the page title: "home/".

    I tried controlling the URL format.
    Using either &fullLink=`TRUE` or &scheme=`full` results in the following:
    <div id="mainMenu">
      <div class="item first">
        <a  class="first" href="http://mydomain.com/subdir/">HOME</a>
      </div>
      <div class="item active">
        <a  class="active" href="http://mydomain.com/subdir/about/">ABOUT</a>
      </div>
      <div class="item ">
        <a  href="http://mydomain.com/subdir/findus/">FIND US</a>
      </div>
      <div class="item last">
        <a class="last" href="http://mydomain.com/subdir/contactus/">CONTACT US</a>
      </div>
    </div>

    Again, without the homepage title.

    If I add &excludeDocs=`1` to my Wayfinder call, all of the links are the same format, so the issue appears to apply to the home page only.

    The home page is set in System Settings as the Site start resource (site_start = 1).

    Can anyone explain to me why this happens for the start page and how I can get Wayfinder to format that page's link URL the same as the others, with the page title included?

    Thanks.
      • 10525
      • 247 Posts
      C'mon modx community! Surely someone knows the answer to this?..... smiley