We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11974
    • 2 Posts
    I’ve picked up MODx and have been working with it the past few days on and off as a solution for a web site I’ve been tinkering over. I’ve gone through the wiki and noticed the multi-language tutorial located there.

    Basically I’m interested in creating a conditional platform where at the root, a session is stored for language selection. After that, the conditional determines the language served.

    By using quite a few custom TV’s with a snippet as the conditional structure -> [*longtitle*] -> [*longtitle-eng*],[*longtitle-spa*],[*longtitle-deu*] etc.

    I’m not familiar with the core of ModX so I’m asking first if it is feasible.

    Snippets:
    ChangeLang - A simple conditional/switch for language switching to be inserted in the template. Pulls the URL of the page, so it can switch smoothly between languages of the same page.
    LangSession - Handles the session variable for $_SESSION[’customlang’]
    SelectLang - Another conditional/switch for choosing which TV to use.

    TV’s:
    xxxx-yyy (Where xxxx is the core tv base name (longtitle/content etc), and yyy is the 3 letter language code)


    The reason I want to do this is because it doesn’t make sense to have copies of the web site for different languages for a small web site and have to go to each page individually to edit. (Larger may run into cache issues from what I understand so far of the core.) The goal with this is that you can edit multiple language versions of the site from one document utilizing different TV’s and a conditional.

    Thoughts?
      • 22303 MODX Staff
      • 10,725 Posts
      You can do it that way, but, how will search engines index your pages in different languages if they all come from the same URL?
        • 11974
        • 2 Posts
        I was thinking of doing a robots.txt and using a redirect to a language subdomain. The subdomains each point to the same folder/files but will present a different language.

        http://eng.website.com/index.php?id=#
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: Helios2291 at Oct 22, 2008, 12:17 AM

          I was thinking of doing a robots.txt and using a redirect to a language subdomain. The subdomains each point to the same folder/files but will present a different language.

          http://eng.website.com/index.php?id=#
          I’m sorry, how would you redirect for each language? The bots would always get the default language, no?