We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18830
    • 161 Posts
    I’m working at a multilanguage site with this structure

    root
      de
        german doc
      en
        english docs

    To change the menues or the contact forms I’m using PHx and UlimateParent. That’s not too hard.

    Now the client wants a guestbook. I build this with Jot. Of course I need only one guestbook for both languages that shows up on the german menue as well as on the english. The links should be  /en/guestbook or /de/guestbook and I would like to change the guest books forms and so on accordingly. So I would need the IDs of the language folders.

    A similiar problem I´ve got with MaxIGallery.

    I have not the faintest idea how I could achieve this. Is there anyone with an idea?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use weblinks with added &lang=en or &lang=de, then in your actual guestbook page have a snippet to get that from the GET and specify which chunk templates to use. Probably best to use $modx->runSnippet with a different argument array for each language.
        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
        • 18830
        • 161 Posts
        Well thank you, Sottwell. Not sure, I’ve got it, but at the moment I can’t try to make it out because I have some earnest problem with this site. http://modxcms.com/forums/index.php/topic,14290.0.html
          • 18830
          • 161 Posts
          Here is my solution (It took my some time to find it because I’ve tried hard to get my site running again. Now I know: neverever ignore OpenGeeks warning: Neverever delete this base-element from the HTML-Code ;-) )

          Like Susan pointed out I created two weblinks with added ?lang=de and ?lang=en parameters.

          and then I just needed a little snippet called "lang":

          $lang=$_GET['lang'];
          return $lang;
          


          To modify the output of the gallery I use PHx like that:

          [+phx:if=`[[lang]]`:is=`de`:then=`german stuff`:else=`english stuff`+]