We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I'm just beginning to study how Revo works, and I have what's probably a very silly question.

    If I have a site with a landing page that offers links to two separate sections (regional and other differences), as well as a handful of other "global" pages, would this be best dealt with using three contexts? One for the landing and other "global" pages (web context) and two regional contexts? I think that's exactly what they're for, but would like to be sure before I get tangled up in something I haven't the slightest clue about.
      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
      • 22427
      • 793 Posts
      Anyone?
      I'm very interested in replies to this question.
        • 34027
        • 30 Posts
        IMO, contexts can be used for a lot of things - there's no one right answer.

        One good use of contexts is if you want to have two sites that share users, templates, chunks, snippets, etc., but each site has to have different system settings (e.g. each site has a different cultureKey for internationalization).

        We typically use contexts in cases where a client has a bunch of sites that are related to each other but each has separate domain names and page trees. Typically each context maps to a domain name (or separate host, e.g. fr.example.com vs en.example.com for French and English sites).



        • You can use any logic you can conceive of to route requests to a specific Context, whether it be a separate domain, a subdomain, a subfolder in the request, a cookie value, or <insert you idea here>.

          We will be creating more sample packages and accompanying tutorials in the very near future to provide concrete examples of a variety of common use cases. Let us know if you have specific use cases you would like to see covered other than contexts as domains, subdomains, or subfolders.
            • 3749
            • 24,544 Posts
            Your idea is sound and very much in the ballpark of what contexts are for, but contexts introduce a level of complexity that can raise a number of issues (e.g., extras that have to work in multiple contexts, logging in to multiple contexts, cross-context links, etc.). All are solvable and usually stay solved once you figure them out, but you have to weigh the pros and cons of using contexts.

            It sounds like you might be able to use parent folders and @INHERIT TVs to organize the three sections. Personally, I tend to shy away from contexts unless, as michael.graham says, the separate contexts require different System Settings, a full-blown multi-language site is required, or they are completely separate sites served by the same core. YMMV. wink



            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              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