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

    I have a strange issue with my wayfinder menu. I have two domain names for my website. The primary is mydomain.tv, the secondary is mydomain.ch. Sometimes, the menu that wayfinder creates points to the .tv domain, sometimes to the .ch domain. For example, when I am on a page with .tv and wayfinder points to .ch, the page opens in a new window or tab.

    I can’t figure out when it happens and way? Does anyone have an idea to solve this issue?

    thank you!
      Modx 2.1.3, PHP 5.2
      • 33968
      • 863 Posts
      Calling the site_url uncached in your template like this
      <base href="[[!++site_url]]" />
      

      should always keep your Wayfinder links on the current domain, if that’s the behaviour you need.

      As for opening in a new window, that’s a bit strange. Check the html output from your Wayfinder menu. Do any of the links contain ’target="_blank"? Which browser are you using?
        • 27117
        • 28 Posts
        hi lucas

        thank you for your help but it’s the same issue when i try your solution.

        It happens in ie 7 and 8, FF, and Safari. I have not tested in Chrome and Opera. The link did contain the target="_blank" but I don’t know why...

        I have done some more testing. The problem is always the link to "home", which is the first page in my tree and has id 1. When I am on a .tv subpage and I click on the home button, it opens the page in a new window. Wayfinder creates that link with a target="_blank".

          Modx 2.1.3, PHP 5.2
          • 33968
          • 863 Posts
          Could you post your Wayfinder call here, along with the contents of ’rowTpl’ chunk if you are using a custom template?
            • 27117
            • 28 Posts
            Wayfinder call
            [[wayfinder? &startId=`0` &level=`2` &outerTpl=`tb_navContainer` &hereClass=`current`]]


            outerTpl
            <ul class="sf-menu">[[+wf.wrapper]]</ul>


            I did some more testing in Safari and FF. The target="_blank" is no longer there but I’m pretty shure, that I saw it some times ago.

            If it helps, here is an extraction of the sourcecode:
            <!-- menu -->
            <div class="menu">
            <ul class="sf-menu">
            <li class="first"><a href="http://www.telebaern.ch/" title="Home" >Home</a></li>
            <li><a href="sendungen/" title="Sendungen" >Sendungen</a><ul class="sf-menu"><li class="first"><a href="news/" title="News" >News</a></li>
            ...
            <li class="last current"><a href="kontakt.html" title="Kontakt" >Kontakt</a></li>
            </ul>
            </div>


              Modx 2.1.3, PHP 5.2
              • 33968
              • 863 Posts
              I really just wanted to see if target="_blank" was in your row template, or somehow added as a link attribute. If it’s gone now, let’s hope it doesn’t come back smiley Let us know if it does though... seems a bit weird!
                • 27117
                • 28 Posts
                I really don’t understand, why the target="_blank" is no longer here huh

                But did you see the first link?
                <li class="first"><a href="http://www.telebaern.ch/" title="Home" >Home</a></li>


                It’s pointing to http://www.telebaern.ch instead of http://www.telebaern.tv. The sourcecode is copied from the page www.telebaern.tv/kontakt... this is really strange undecided
                  Modx 2.1.3, PHP 5.2
                  • 33968
                  • 863 Posts
                  If you clear your site cache MODx will then rebuild the menu, but you’ll need to call Wayfinder uncached to prevent the same thing happening again:
                  [[!Wayfinder? &startId=`0` &level=`2` &outerTpl=`tb_navContainer` &hereClass=`current`]]
                  


                  Is there a reason why your content is spread across two domains like that? I had a quick look and it seems both domains have the same content - that could be limiting your site’s potential to rank highly on the search engines. I would recommend you to choose one as your ’primary’ domain and then set up a redirect on the other one.

                  You won’t have any Wayfinder problems that way either wink
                    • 27117
                    • 28 Posts
                    Clearing the site cache and calling wayfinder uncached seems to solve the problem. I have done some more tests and now it works!

                    Well, the problem with the 2 differnt domains is the following: our old site was under telebaern.ch. For the relaunch of our new website, we thougt, that telebaern.tv is better because we are a tv station laugh

                    The primary is always telebaern.tv but you are right, telebaern.ch should redirect to the .tv domain instead of just holding the same content. I have to talk to our it guys how to set this up correctly, I’m just the guy who has to care about the website and my knowledge about all that technical stuff is limited.

                    Thank you for your help and your advice!
                      Modx 2.1.3, PHP 5.2
                      • 33968
                      • 863 Posts
                      No problem smiley

                      If you can sort out the redirect then you will be able to call Wayfinder cached and your pages will load a bit faster too.

                      And... here’s some advice from Google on moving to a new domain.