We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17069
    • 6 Posts
    Hi Guys,

    Have been trawling the forums and Google for a while, but to no avail sad

    We have a template which calls a few Snippets. When the template is called from a document within the ’web’ context, all works fine. However, if it’s called from a document from a different context (accessed from a different domain) it doesn’t work.

    Any ideas?

    Thanks
      Regards,
      William
      • 28215
      • 4,149 Posts
      Quote from: LG-William at May 20, 2010, 12:49 PM

      Hi Guys,
      Have been trawling the forums and Google for a while, but to no avail sad
      We have a template which calls a few Snippets. When the template is called from a document within the ’web’ context, all works fine. However, if it’s called from a document from a different context (accessed from a different domain) it doesn’t work.
      Any ideas?
      Thanks

      Would have to see the snippets, but have you setup your Context Access correctly?
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 22303 MODX Staff
        • 10,725 Posts
        Can you describe the Snippet that is not working? Kind of hard to know what you are experiencing without better understanding what it is you are actually doing.
          • 17069
          • 6 Posts
          Hi,

          Thanks for speedy reply! smiley

          It seems irrelevant what the snippet is, as even a basic:
          <?php
          return 'Hello world';
          ?>

          One doesn’t work.

          Access Controls - errr, nope, not changed anything in there. Is there some documentation somewhere about setting up Access Controls on a multi-context Revo site? Or any quick-tips you think we need to follow?

          Thanks
            Regards,
            William
            • 17069
            • 6 Posts
            Also - just to confirm. Loading ’chunks’ are fine. It seems only snippets that are affected with being in different contexts.
              Regards,
              William
              • 17069
              • 6 Posts
              Ok, this gets weirder.

              I made a couple of tweaks to the context settings (site start id’s etc) and suddenly the snippets started working. Did something else in the manager (edit a resource) and the snippets stopped working again ont the front end.

              Now, they randomly appearing and disappearing. I seem to make a change in the Manager and the snippets will load up on the front end no problem. I then edit something again in the manager (nothing that would have an impact) and they then disappear. The ’web’ context however always shows the snippet output.

              Weird!

              Could it be a session / cache / cookie problem with the manager session or something? :S
                Regards,
                William
                • 22303 MODX Staff
                • 10,725 Posts
                Quote from: LG-William at May 20, 2010, 01:40 PM

                Now, they randomly appearing and disappearing. I seem to make a change in the Manager and the snippets will load up on the front end no problem. I then edit something again in the manager (nothing that would have an impact) and they then disappear. The ’web’ context however always shows the snippet output.

                Could it be a session / cache / cookie problem with the manager session or something? :S
                I do not know without more details. You say it is nothing that would have an impact, but apparently it does. If we start with that maybe we can figure something out with you. It should be session or cookie related if you are accessing it via the same domain everytime, i.e. accessing via www and non-www URLs would have different sessions by default (unless you set your session_cookie_domain to be .domain.tld).
                  • 17069
                  • 6 Posts
                  Just to let you know, that this issue has disappeared in 2.0.0-pl smiley
                    Regards,
                    William