We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12387
    • 20 Posts
    Hi, I planning to make my site is Multi Languaged, but I have already image gallery (Maxigallery), what are your suggestions to share it across all language versions without to copy it multiple times?
      • 727
      • 502 Posts
      Wrap the snippet to MaxiGallery inside another snippet. You can then use this "wrapper snippet" on all the pages you want.

      Andy
        • 12387
        • 20 Posts
        Interesting method... I must to try it, and it can be the answer to my another question regarding showing childgalleries on other pages than their parent. But one property stay out from this solution- what about the language of descriptions, can you suggest something regarding it? I mean assume that I getting gallery wrapped, but how do I get descriptions and titles translated?
          • 727
          • 502 Posts
          Here is how I do it:

          Create a template variable called "language" with a default of "en".
          For each page that is not english set the template variable to the language code of the page, e.g. "de".
          Create chunks for each piece of text to display, starting with the language code. For example:

          en_gallerydescription
          de_gallerydescription

          Hack the gallery snippet (or create a custom snippet perhaps?) to get the language for the current page, then get the correct chunk for the language and add to output.

          I use this and a table of tokens for short strings (like error messages, etc.) in my multiligual sites.

          Andy
            • 12387
            • 20 Posts
            Thanks for your tips, I tried to get your wrapper snippet suggestion to work, but without success, can you explain a little more, or put some quick example?
              • 727
              • 502 Posts
              I think you need to write something like:

              $modx->runSnippet(snippetname, parameters)


              See: http://wiki.modxcms.com/index.php/API:runSnippet

              Andy
                • 12387
                • 20 Posts
                Thank you very much for input, Andy, I’ll try to get it to work.
                  • 12387
                  • 20 Posts
                  Still trying to implement your method and stuck in following: I made few containers for languages, but pointed for start page for home page of particular language in site preferences, is it okay for Google? I made some mistake in TV for few pages, and they giving MODx parse errors now, I guess I put "," at the end, or something like that, is there any way to edit TV values from backend?
                    • 31507
                    • 1 Posts
                    I try to use this guide but don’t get the template variable right. I follow the guide:

                    "Create a template variable called "languages", with the type "text". Associate this with all your template(s).
                    Edit your templates to call the Languages snippet with no parameters. Place it where you want the flags to appear. Users click on the flags to change the language.
                    "

                    I type in "languages" as the name of the TV, and with the type "text". But when I hit Save I get an error which says:
                    $rs not set! New variable not saved!

                    What’s that supposed to mean? Am I doing something wrong? undecided
                      • 727
                      • 502 Posts