We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49481
    • 32 Posts
    I have a second context which uses a different domain name.

    The context itself is working because if I put some html into the template it shows up.
    If I try to use migxmultilang on this template however (the mmlCache call) I just get a blank white page.

    I've tried different chunks in the &tpl parameter; no use.

    It works fine for any resource in the primary context.

    Is there anything special that needs to be done for migxmultilang and different domain names?

    This question has been answered by Bruno17. See the first response.

    • Since it uses pdoResources in the mml_baseTemplate (or whatever templates you are using) you would need to add the &context=`...` property. I would imagine that you would also need to use appropriate context settings instead or in addition to system settings.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 49481
        • 32 Posts
        Quote from: sottwell at Jan 16, 2015, 07:06 AM
        Since it uses pdoResources in the mml_baseTemplate (or whatever templates you are using) you would need to add the &context=`...` property. I would imagine that you would also need to use appropriate context settings instead or in addition to system settings.

        Thanks Susan, but it still seems to be doing the same thing.
        I've added the &context=`secondcontext` parameter with the name of the context that holds that resource and both of my contexts have the base_url, site_url, site_start and http_host settings.
          • 44195
          • 293 Posts
          I gave this a go and it doesn't seem to be working for me either. I sent a tweet to Bruno about it... maybe we're missing something simple.
            I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
            Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
            • 44195
            • 293 Posts
            It appears to be changing the cultureKey correctly depending on the URL on the second context... it's just not showing the assigned chunk.

            I put some tags under the mmlCache call on the template in the second context.

            [[!mmlCache?
              &element=`pdoResources`
              &parents=`0`
              &resources=`[[*id]]` 
              &tpl=`lsEnrolPage` 
              &includeContent=`1`
              &includeTVs=`[[mmlGetTemplateTVs]]` 
              &prepareTVs=`1` 
              &processTVs=`1`
              &tvPrefix=`` 
              &loadModels=`migxmultilang`
              &prepareSnippet = `mmlTranslatePdoToolsRow`
            ]]
            [[!++cultureKey]]<br>
            [[!++site_url]]<br>
            [[!++original_cultureKey]]<br>
            [[!++original_site_url]]


            If I type the second context URL into my browser with the language extension it shows the cultureKey is changing.

            e.g.
            http://www.seconddomain.com/en/

            gives the output:
            en
            http://www.seconddomain.com/en/
            en
            http://www.seconddomain.com/


            and typing in:
            http://www.seconddomain.com/zh/

            gives the output:
            zh
            http://www.seconddomain.com/zh/
            en
            http://www.seconddomain.com/
              I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
              Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
              • 44195
              • 293 Posts

              Removing the entire &includeTVs property allows the chunk to be displayed (instead of a blank page) but of course no TV values come through.

              [ed. note: muzzstick last edited this post 9 years, 3 months ago.]
                I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
                Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com
                • 49481
                • 32 Posts
                Anyone able to get this working with a second context? If so, how?
                Could I perhaps install Lingua in addition to Migxmultilang and use that one on the second context?
                  • 4172
                  • 5,888 Posts
                  I have migxMultiLang working on multiple contexts

                  I'm using the xrouting-plugin to switch to the contexts
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 49481
                    • 32 Posts
                    Hi Bruno,
                    I've tried the xrouting-plugin, gatewaymanager and copying the modx index.php into a separate directory and initialising the second context.
                    They all work in terms of routing between the contexts if not using migxmultilang in the template.
                    Is there a way of working out why it's failing? A migx log or something like that?
                    Thanks
                      • 4172
                      • 5,888 Posts
                      do you get something, when you add to the mml_cache - snippet call
                      &return=`sql`

                      you can also try to disable the
                      &tpl - property

                      do you get an array-output then?

                      what is your mml_cache - call currently?

                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!