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

    I’m a modx newbie and I’m using advanced modx 2.0.2-pl on apache2, linux, php5.3. I have run into problem that I cannot fix easily.

    How can I change the default context? Default context in Modx revo is "web", but I have a multi-language site, that uses different contexts for each language. And "web" context is left unused. I have "hidden" it using ACLs, but then "create new document/symlink/weblink" menu items and buttons break down with error - "context_err_nf", as it trys to use default "web" context. Nothing noteworthy in the logs.
    And I cannot delete "web" context altogether, it always says "Permission denied", even if I’m the administrator.

    Thanks!
      • 22303 MODX Staff
      • 10,725 Posts
      Just keep it there and remove permissions to load it. You cannot remove the web context (or rename it) at this time, as it is the default value for many things in the system.
        • 33524
        • 2 Posts
        Thanks! I did as you said and it worked for me. Still had some gotchas to figure out, before I got any satisfying results smiley

        I created a new role, especially for "web" context, duplicating "Load Only" role, and adding a new permission "Resource Tree". That solved the problem with no resource tree showing up, when pressing default "New Document" buttons in the resource tree or in the top menu.

        I was also able to fix the top menu actions, by adding additional parameter "&context_key=en" to parameters list of each menu item. Still I can set only single "en" as the default context. Ideally I would make a new system setting "default_context" that could be set for individual users and add [[++default_context]] in parameters list, but that didn’t work out. I could try using javascript in the "Handler" field, but I don’t know how to read system settings using javascript. Is there a javascript API documentation for modx?

        Hope this helps other people.