We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    I feel like this is a really stupid question. If I create a context, then put resources in it, how do I link to these from the web (or any other) context?

    For example, resource #1 has a link made with [[~11]]. Resource #11 is in a different context. The link tag doesn't produce anything. huh

    Ok, by giving everybody load, list and view permissions to the context I at least now get a URL for it (although it generates a full URL). But it just goes to the Not Found page. [ed. note: sottwell last edited this post 13 years, 8 months ago.]
      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
      • 38304
      • 68 Posts
      Maybe i can help you too... smiley

      Check Systemsettings:
      Core
      setting_allow_forward_across_contexts to YES

      Greetings Chris
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Hm. That is good to know, but it's not exactly what I was looking for. I suspect that I just don't know enough about contexts. I was hoping that something like
        <a href="[[~11]]">Resource in a different context</a>

        would simply link to the resource in the other context. But while the URL is generated, the link doesn't work.
          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
          • 38304
          • 68 Posts
          Quote from: sottwell at Feb 04, 2013, 08:34 AM
          Hm. That is good to know, but it's not exactly what I was looking for. I suspect that I just don't know enough about contexts. I was hoping that something like
          <a href="[[~11]]">Resource in a different context</a>

          would simply link to the resource in the other context. But while the URL is generated, the link doesn't work.

          In my case it does.

          I can link to a context non existant id within another context after switching to yes in the system setting.

          <a href="[[~13]]">test</a> while no 13 is in linking context but within another context works here.

          Maybe its something within .htaccess in your case.

          Greetings
          CHris
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Shouldn't be; I've actually turned off friendly urls for this. I'll poke at it some more then.
              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
              • 38304
              • 68 Posts
              Wish you good luck!

              setting_allow_forward_across_contexts

              When true, Symlinks and modX::sendForward() API calls can forward requests to Resources in other Contexts.

              BTW. i am on modx cloud... maybe Mark knows what happens on your modx.

              Greetings Chris
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Nope. Just goes to the not-found page, whether friendly URLs or not. The htaccess is just basic, no changes except for the RewriteBase. Everybody has load, list and view for the context, so it shouldn't be a permission problem.
                  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
                  • 42562
                  • 1,145 Posts
                  It is a problem with the Context settings (and/or perhaps 2.2.6 complication). Apart from the link tag showing nothing, are you able to view the page belonging to a non-web context, within the same domain? Does the page itself return a 404 error?

                  Somewhat similar issue
                    TinymceWrapper: Complete back/frontend content solution.
                    Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                    5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    After I set everybody's permissions to load, list and view, I started getting the URL as expected, and it looks correct, with or without friendly URLs. The link goes to the error_page.
                      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
                      • 3749
                      • 24,544 Posts
                      There is a default Context Access ACL entry for anonymous users for the web Context. You need to create one like it for each front-end Context.

                      This is because you need to create a Context Access ACL entry for each Context for the Administrator Group in order for the Admin to see the Resources in that Context in the tree. Once you do that, the Context is protected, so you need to give explicit access to it. Hope that makes sense.
                        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