We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3504
    • 11 Posts
    I followed the tutorial: http://modxcms.com/forums/index.php/topic,29597.msg179898.html for making a multi-language page. Everything works fine there, but i have a problem setting up the ajaxsearch, because i have to specify the landing page ID (i’m making a non ajax search).

    I’m wondering if there is a way to make different landing pages for different languages, because now either i specify the landing page from one language set or from the another.

    Thanks!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Have a snippet that returns a document ID to correspond to the language ID chosen and use that snippet to specify the landing page in the AjaxSearch snippet parameter.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3504
        • 11 Posts
        Quote from: sottwell at Jul 01, 2009, 03:17 AM

        Have a snippet that returns a document ID to correspond to the language ID chosen and use that snippet to specify the landing page in the AjaxSearch snippet parameter.

        Thank you sottwell for quick respond. I’m kinda new with modx, i think i know what snippet you mean from the multilang, but i’m not capable of making it. Could you give a helping hand?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It depends on how you are determining which language to server the visitor. But once you get that (from SESSION, COOKIE, GET, or even from the current document’s parent) you can just make a switch structure using document IDs:
          switch $language {
              case 1: $landing = 23; // for English
              break;
              case 2: $landing = 24; // for German
              break;
              case 3: $landing = 25; // for French
              break;
              default: $landing = 23; // default to English
          }

            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org