We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43303
    • 31 Posts
    I use the MIGX Multilang add-on for multiple languages. I have spanish and englisch. But when i use the "home" link of my site it always goes to the english version. Does anyone know what the problem is? Thanks in advance.

    You can see the problem here: http://jellekok.com/customers/commandeur/es/inclusive-business.html
    And then click on home, you go from spanish to english..

    This question has been answered by Bruno17. See the first response.

      • 4172
      • 5,888 Posts
      seems you do not have a
      <base href="[[++base_url]]">


      in the head, do you?

      It should look like here:
      http://www.webcmsolutions.de/en/modx-extras.html

      like shown in the original mml_resourceTemplate - chunk

      the home-link, should look like

      <a href="">Home</a>


      with an empty href in all languages.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 43303
        • 31 Posts
        i added the "base href", but it doesn't solve the problem
          • 4172
          • 5,888 Posts
          that's because your home-link isn't empty:

          <a href="/customers/commandeur/">Home</a>
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 43303
            • 31 Posts
            Maybe a stupid question, but where can i change this? I looked in the system settings, but it is nowhere to be found.
              • 4172
              • 5,888 Posts
              pdoMenu does call a prepareSnippet

              &prepareSnippet = `mmlTranslatePdoToolsRow`


              maybe you will need your own version of that snippet (with another name)
              where this lines are customized:

                  if ($cultureKey != $main_lang) {
                     if ($row['link'] == $base_url){
                         $outrow['link'] = '';
                     }
                  }
              
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 43303
                • 31 Posts
                I tried to change those lines, doesn't seem to have any influence.

                But shouldn't i be able to edit this line: "/customers/commandeur/" somewhere? Where does he take it from?
                  • 4172
                  • 5,888 Posts
                  your whole mmlMenue - call does look some like that:

                          [[!pdoMenu? 
                              &startId=`0` 
                              &level=`1`
                              &includeTVs=`mml_pagetitle,mml_menutitle`
                              &prepareTVs=`1`
                              &tvPrefix=`tv.`
                              &loadModels=`migxmultilang`
                              &prepareSnippet = `mmlTranslatePdoToolsRow`
                              &tpl=`mml_MenuRowTpl`
                          ]]
                  


                  right?

                  the tpl-chunk for each row in this case is mml_MenuRowTpl
                  there is the placeholder [[+link]]

                  This placeholder gets replaced with the link for each resource by pdoMenu.
                  For the Home-Link this needs to be modified, what is done in this lines:

                  if ($cultureKey != $main_lang) {
                     if ($row['link'] == $base_url){
                         $outrow['link'] = '';
                     }
                  }


                  If you need something special for your specific situation/settings
                  you need either to manipulae this lines, or have a special outputFilter at the placeholder
                  [[+link]]

                  to see, what happens at this point, try to change this lines to
                  echo $cultureKey . '<br>';
                  echo $main_lang . '<br>';
                  
                  if ($cultureKey != $main_lang) {
                  
                      if ($row['pagetitle'] == 'Home'){
                          echo $row['link'] . '<br>';
                          echo $base_url . '<br>';
                          die();
                      }
                      if ($row['link'] == $base_url){
                          $outrow['link'] = '';
                      }
                  }











                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 43303
                    • 31 Posts
                    nothing happens/changes
                      • 4172
                      • 5,888 Posts
                      ok, try it this way

                      echo $cultureKey . '<br>';
                      echo $main_lang . '<br>';
                      if ($outrow['pagetitle'] == 'Home'){
                          echo $row['link'] . '<br>';
                          echo $base_url . '<br>';
                          die(); 
                      }
                      
                      if ($cultureKey != $main_lang) {
                          if ($row['link'] == $base_url){
                              $outrow['link'] = '';
                          }
                      }


                      I get then:

                      en
                      de
                      /
                      /
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!