We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33968
    • 863 Posts
    I'm looking at ways to approach a client requirement to manage 50-150 domains in one Revo install, under a sort of white-labelling arrangement. Many of the domains will have unique content and it also has to be multi-lingual.

    I'm considering representing domains/sites as contexts, using language subfolders and Babel to handle the language requirements. Each context will hold roughly 5 resources in each language folder.

    Has anyone tried using that many contexts before (50-150)? Any issues expected? What about the file tree, am I to expect that to explode or anything?! shocked


    Or... any better suggestions on how to approach this? Cheers
    • You are not alone; there are others using Revo in a similar way to host more than 150 contexts in a single installation. While there may be issues encountered, they would be addressed as bugs or improvements, and your approach seems sound IMO. I know very little about Babel, but if that didn't work in this scenario, I'm sure a solution could be found or created.
        • 33968
        • 863 Posts
        Great, I'm now quite confident I'm going in the right direction. Babel won't work out of the box on this but with some modifications should handle the language switching quite nicely.

        Thanks
        • I have an install with over 50 context and haven't had any issues, they all share chunks, snippets and tpls, we also use MODX resources to generate the CSS and JS files for each context and it works perfect.

          The most important thing is to make a blue print of how your going to do the architecture for it if you plan on sharing things with each context, context settings are your friend to take care of most of these issues.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 33968
            • 863 Posts
            Hi Ben - glad to hear it's working well for you. I've built out a rough structure to test on and it seems to be working nicely. Yeah, Context Settings are a huge convenience here as a number of other components need to be integrated which are very site specific. Plus it all looks very tidy and intuitive for my manager users... cool.
              • 33968
              • 863 Posts
              Ok so I'm having problems with changing System Settings on the fly. Some of the contexts are multilingual with language folders containing translated content. I'd like to be able to set a site_start setting dynamically, depending on the detected/requested language.

              I've set the site_start System Setting to '0', then in my Gateway plugin I have code that handles routing to the correct language folder.

              I'm trying to set site_start on every page load like this, in my plugin:
              $langFolderId = 300; // for example
              $modx->setOption('site_start',$langFolderId);
              

              However the site_start placeholder always shows '0' instead of '300', even called uncached:
              [[!++site_start]]
              

              I've tried firing this on all available front end events, and also within a snippet and the placeholder always shows the cached value.

              However if I create an uncached snippet containing this:
              return $modx->getOption('site_start');
              

              It shows the new value (300).

              Is this going to be possible to achieve or should I just use $modx->toPlaceholder('site_start',$value) instead? [ed. note: okyanet last edited this post 11 years, 9 months ago.]
              • setOption() does not change a System Setting in the database, only for the duration of the current request. Changing site_start dynamically it not a good idea; I would have your context routing plugin simply use a different custom context setting for each language, e.g. site_start_en, site_start_jp, etc.

                You could use it like this:
                [[!++site_start_[[!++lang]]:default=`[[++site_start]]`]]
                  • 33968
                  • 863 Posts
                  Funny, I've actually created those exact Context Settings already. It just didn't occur to me to set the default via Output Filter. All good now - thanks so much for your input smiley