We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30876 ☆ A M B ☆
    • 39 Posts
    Revolution 2.2.7 - using Bootstrap theme -
    I currently have an English/Chinese site successfully using Babel Translation plugin to switch between languages.
    I am trying to add and run an additional site in the MODX installation using ContextRouter.
    I can get both sites to work but it causes the Babel translation plugin in the original site to stop functioning.

    Below is the gateway script that the Babel plugin uses which seems to be over-ridden somewhere by the ContextRouter module.
    If anyone could point me in the right direction to resolve this I would be most grateful.

    if($modx->context->get('key') != "mgr"){
                    /* grab the current langauge from the cultureKey request var */
                    switch (isset($_REQUEST['cultureKey']) ? $_REQUEST['cultureKey'] : 'en') {
                        case 'zh':
                            /* switch the context */
                            $modx->switchContext('zh');
                            break;
                        default:
                            /* Set the default context here */
                            $modx->switchContext('web');
                            break;
                    }
                    /* unset GET var to avoid
                     * appending cultureKey=xy to URLs by other components */
                    unset($_GET['cultureKey']);
                }
      • 30876 ☆ A M B ☆
      • 39 Posts
      I will try and clarify it a bit more -
      The domain setup is:
      1. The original main site - www.domain1.com which has the Babel plugin with English/Chinese language pages - It uses the en/zh culture key to switch contexts.
      2. The new add on site - www.domain2.com is a separate website within the single MODx installation and will be in Chinese only.

      So far with the Babel plugin installed (and no ContextRouter installed) the www.domain1.com switches between en/zh contexts and the www.domain2.com url defaults to the www.domain1.com homepage.
      With the ContextRouter plugin installed, the www.domain2.com site works and is visible, so too is the English version of www.domain1.com but the Chinese version of is not visible.

      I have also tried the two manual configuration methods here - http://www.belafontecode.com/modx-revolution-hosting-multiple-domains/ with no success either.