We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53521
    • 26 Posts
    Is there a way to configure MODX so that the contexts appear visually different(ie background color). I find myself frequently looking at the way I did something in a different context and usually making the changes in the correct context, but I am going to have some new users who I know will have a problem with multiple contexts all being accessible from the manager at one time.

    Thanks
    Steve
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Visually different in the frontend or in the backend?

      For the frontend, you can create context settings that sets some styles or loads a different CSS file. For the manager I'm not aware of any pre-built options, also because many actions in the manager are not context-specific.
        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.
        • 3749
        • 24,544 Posts
        You could create colored icons for the main context folders with Context Settings for the mgr_tree_icon_context key.

        I think it would be possible to style the individual contexts in the tree with CSS, but it would be tricky and might require JavaScript. It would probably slow down the rendering of the tree.
          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
          • 17301
          • 932 Posts
          Assuming that the context orders won't change you could create a new CSS file and include that in the header and then use nth-child selectors to colour the different contexts.

          .x-tree-root-node li:nth-child(2) .tree-pseudoroot-node { background-color: red!important; }
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 53521
            • 26 Posts
            Sorry not to include in the original post but I meant the backend. We have some editors who will have access to multiple contexts in the manager and I can see some future confusion if not problems.

            I will check into both BobRay and LKs suggestions. Thanks!
              • 53521
              • 26 Posts
              Mark,
              Thanks for the comment on the non-context specific actions. I think I understand what you are saying and I am not really concerned about the managers actions for these users but I am more concerned about them editing a document or creating one in the wrong context.