We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26681 MODX Staff
    • 123 Posts
    Recently started using Contexts in Revo and after some initial confusion and troubleshooting, it’s working great. For anyone else new to setting up Contexts, here’s a little log of useful tips to get it working (thanks to @amdbuilder and @mark_hamstra for helping me on all this).

    First off, the Contexts documentation: http://rtfm.modx.com/display/revolution20/Contexts

    This page in the documentation got me most of the way: http://rtfm.modx.com/display/revolution20/Creating+a+Subdomain+from+a+Folder+using+Virtual+Hosts

    However, on Site5 (as it is on other hosts too I’m sure) when you setup a new domain, the host automatically provides a pointer to a new folder in your account’s root. This replaces the "Creating a Virtual Host" section - besides, I don’t have Apache access on Site5 anyways.

    At this point I was getting a 503 error, which was fixed by pointing the child site to the MODX core folder. This blog post seems to consolidate all the required steps in detail. I didn’t do it exactly this way, but reading this should help you cover all your bases: http://www.belafontecode.com/modx-revolution-hosting-multiple-domains/

    There you go. Nothing new, but a single place in the forums to find help setting up Contexts. Of course I might be missing something so please comment with additional info.

    Cheers, Sepia River
      [sepiariver.com] (https://sepiariver.com/)
      • 33337
      • 3,975 Posts
      Definitely helpful for new comers.

      Thanks Sepia River!
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 34000
        • 77 Posts
        @sepiariver are you still hosting on Site5 then? I’ve heard good things about site5 is why I’m asking.
        Found out last night that site5 has a coupon code for a free 30-day trial run hosting offer.

        I’ll have to jump out and read your blog post then.
        thanks.
          MODx Revo 2.1 and done!
          • 26681 MODX Staff
          • 123 Posts
          Still using Site5. I would say they’re among the best I’ve ever used. Firehost is apparently really good too - they host for MODX, but I’ve never used them.

          **If you’re in the Pacific Northwest, I have a VPS from Site5 in Seattle that I could set you up on. Same cost as shared hosting but many benefits tongue

          [email protected]
            [sepiariver.com] (https://sepiariver.com/)
            • 34000
            • 77 Posts
            I got an email off to you then SepiaR.
            It included my life’s history as well as dreams and aspirations, lol, in condensed form of course. wink
              MODx Revo 2.1 and done!
              • 26681 MODX Staff
              • 123 Posts
              Here’s an example of this multiple-context implementation in action: http://hdlgroup.ca

              Note the main menu items link to entirely "different" sites with their own TLDs, but it’s all managed under the same install using Contexts.

              Brilliant. YAY MODX.
                [sepiariver.com] (https://sepiariver.com/)
                • 19980 ☆ A M B ☆
                • 275 Posts
                hi

                do you know why
                [[*id:context:is=`web`:then=`3`]][[*id:context:is=`fin`:then=`3`]][[*id:context:is=`rus`:then=`3`]][[*id:context:is=`estonian`:then=`3`]]

                gives empty and not 3 on any page?
                  modx and ecommerce pro
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Where’d you get the :context output filter from? Didn’t know that existed.

                  I’d probably just go with [[*context_key:eq=`web`:then=`Gotcha!`]] though smiley
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 19980 ☆ A M B ☆
                    • 275 Posts
                    Hi thanks for reply

                    I was also surprised when found this type of code on the one site.

                    It really works! ;-) It ’s used for multilang plugin Babel

                    So for example when there is 1 template but different menu items should be retrieved per each context

                    [[wayfinder start=`[[*id:context:is=`web`:then=`3`]]:else=`5``]]

                    But this is not working on my Babel installation 8-) and I will use your example, thanks you
                      modx and ecommerce pro
                      • 19980 ☆ A M B ☆
                      • 275 Posts
                      By the way,

                      do you know if there is more complex then just this simple construction

                      if then else

                      ?



                      I mean I would more need something like


                      if then
                      else if then
                      else if then
                      ...
                      ...
                      else


                      Thanks!
                        modx and ecommerce pro