We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23547
    • 32 Posts
    I just completed a fresh installation of Revolution 2 beta 5. Installation was a breeze, and the management interface is just awesome. I really must commend the devs for the effort that they put into coding this thing of beauty. I am working with Joomla on another project, but the management admin interface of Revo is super.

    Next task is to figure out how to create a multi-lingual site on Revo. if you have any solid ideas on how to accomplish this, please post here.

    Thanks,
      • 3749
      • 24,544 Posts
      I’d suggest taking a look at contexts: http://svn.modxcms.com/docs/display/revolution/Contexts.

      Welcome to MODx. smiley
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 23547
        • 32 Posts
        Thanks. I’ve read what I could find about contexts, and understand it a bit. So here’s what I have done so far, not much, but further than where I was yesterday: I’ve created a new context, calling it "es." That’s the two-letter code for Espana. The default context, "web," would be the default language, "en." The plan is to create a context for each language I intend to support.

        Here’s what I want to see at the frontend, when visitors access the site: If English-speaking users click on the "en" flag, I want the url to read http://mysite.com/en/, and http://mysite.com/en/<resource> for any other English language resource. Same will apply to other contexts, e.g., http://mysite.com/es/ and http://mysite.com/es/<resource>. This entails that the name of the context is part of the url.

        I don’t have much experience implementing stuff like this, so I’ll welcome any input, links to docs, etc.

        TIA
          • 3749
          • 24,544 Posts
          Full disclosure: I’ve never actually created a multi-language site.

          That said, there are two common ways to go here. One is to create two virtual domains (or just two separate subdirectories under public_ftp), one for each site, in separate directories as described here: http://svn.modxcms.com/docs/display/revolution/Creating+a+Subdomain+from+a+Folder+using+Virtual+Hosts. Each directory will have its own index.php and config files. Only one of the directories has a MODx install, which is shared by both contexts. In this method, if the two sites have different assets (images, files, etc.), they can have the same names but different locations. The index.php file initializes the appropriate context.

          The way other is to have a single directory, but change the context with a plugin based on the URL that the user comes in on as described here: http://svn.modxcms.com/docs/display/revolution/Using+One+Gateway+Plugin+to+Manage+Multiple+Domains. Different assets would then have to have different names (or at least a different prefix).

          In both cases, you’d want to create context settings in each context for the various paths and URLs (e.g. base_path, site_url, etc.).

          I hesitate to say which method would be better for you since I haven’t used either one for a live site.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 23547
            • 32 Posts
            Thanks for the feedback. Both methods appear to be geared towords creating and managing multi-site or multi-domain installations. Using the first method, for example, I’ll be getting urls of this sort: en.mysite.com, en.mysite.com/testpage, etc instead of mysite.com/en, mysite.com/en/testpage, etc.

            For creating a multi-lingual installation, I think a slightly different method is needed. Like I discribed earlier, I have created a new context for one of the languages, and have been able to create resources or documents under that new context. Problem is when I preview one of those resources, the system displays a resource from the default context (web) instead. Is there a way to specify to the system - from within the manager interface - what the base path for each context should be?
              • 3749
              • 24,544 Posts
              Quote from: planner at Mar 22, 2010, 06:25 PM

              Thanks for the feedback. Both methods appear to be geared towords creating and managing multi-site or multi-domain installations. Using the first method, for example, I’ll be getting urls of this sort: en.mysite.com, en.mysite.com/testpage, etc instead of mysite.com/en, mysite.com/en/testpage, etc.

              For creating a multi-lingual installation, I think a slightly different method is needed. Like I discribed earlier, I have created a new context for one of the languages, and have been able to create resources or documents under that new context. Problem is when I preview one of those resources, the system displays a resource from the default context (web) instead. Is there a way to specify to the system - from within the manager interface - what the base path for each context should be?

              No, you can have the URLs you want in either method. Using the index.php method, you’d create two directory structures that match the URLs you want. In the plugin method, you’d create two virtual domains with the URLs you want. In either case, you need to initialize the correct context either in the index.php file or the plugin before users will see the correct resources. And you’ll need to create context settings for the base url and base path for each context.

              Hopefully, someone will create a good tutorial on creating a multi-language site in Revo with step-by-step instructions. Maybe it will be you. wink
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting