We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    Did you try this:

    Put your Templates into categories

    Go to Security->Access Controls

    Update User Group
    Open the tab: Element Category Access
    ->Add Category
    Select the category
    context: mgr
    Access Policy: Load only

    with 'load only' the usergroup should not have the permission to list the templates which are in this category

    doesn't this work?
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 39333
      • 151 Posts
      That does work! And doesn't mysteriously make the TV tab disappear. Those old instructions were inadequate. Thanks Bruno!

      OK a little deeper. Is there a way I can remove the "empty" template option for standard users? And also is there a way to block template change completely by standard users on select resources?
        MODX...the Zen of CMS
        "Bight off more than you can chew and keep right on chewing."
        • 3749
        • 24,544 Posts
        Good catch Bruno, I should have thought of that.

        The only way I can think of to remove the "empty" template option would be a plugin connected to OnDocFormPrerender. I think I'd use JavaScript to remove the code for that option and use $modx->regClientStartupScript() to inject it into the header. There may well be an easier way.
          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
          • 39333
          • 151 Posts
          Bob! Quit playin lol

          How about if I use .net to parse the data and Python to deliver it to the manager back end thus removing the middle man?

          Would that work?
            MODX...the Zen of CMS
            "Bight off more than you can chew and keep right on chewing."
            • 3749
            • 24,544 Posts
            Lol. I would run it through Perl and a C script after .net parses it but before passing it to Python. wink

              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
              • 39333
              • 151 Posts
              lmfao...you really want a person to work for solutions, that's a lot of coding!

              OK one more question. Is the answer in your book!?
                MODX...the Zen of CMS
                "Bight off more than you can chew and keep right on chewing."
              • Actually Bob's javascript solution was a good one. How do you think Evo's ManagerManager worked? It was all done in the javascript in the DOM.

                That said, there was no way to manipulate the forms in the back-end (on the server) because the forms were built field by field with mixed HTML and inline PHP. Revo forms, however, are built all in PHP and are available in full for meddling within a plugin. So you could write your own plugin to check the user's group and remove the field from the form for such users. The built-in Form Customization just provides a (relatively) convenient UI for it. [ed. note: sottwell last edited this post 11 years, 2 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
                  • 39333
                  • 151 Posts
                  Double teamed by the DOM, damn!

                  Worked out the selector hiding part on selected resources. [ed. note: eric.swd last edited this post 11 years, 2 months ago.]
                    MODX...the Zen of CMS
                    "Bight off more than you can chew and keep right on chewing."
                    • 3749
                    • 24,544 Posts
                    No. wink

                    BTW, I looked at that panel in Firebug and the empty option is a div and is the first child of the div with this ID (at least in my version of MODX):

                    id="ext-gen522"


                    I tried the code below in a plugin attached to OnDocFormPrerender, but it doesn't work. I blame ExtJS. It appears that the drop-down doesn't exist until you click on it. I tried registering an onClick event for the parent, but still no luck, so it's obviously nastier than I thought. I give up. wink

                    JS is not my string suit, so maybe someone else can suggest a way.

                    $js = '<script type="text/javascript">
                    (function(){ 
                        var container = document.getElementById("ext-gen522");
                        var field = container.firstChild;
                        if (field.indexOf("empty") != -1 ) {
                            field.style.visibility = "hidden";   
                        }
                    }());
                    </script>'
                    
                    $modx->regClientStartupScript($js);
                      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
                      • 39333
                      • 151 Posts
                      Soooo....
                      To hide the empty template selector I would need to add it to the admin element category. But the empty template, template 0, does not show in the list to do so.

                      Hmmmmm
                        MODX...the Zen of CMS
                        "Bight off more than you can chew and keep right on chewing."