We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39333
    • 151 Posts
    This seems like a stupid question to me but I can't find the answer. Searched the forums and engines high and low with nothing remotely close coming back.

    Is there a way to hide Template 0, empty template, from the drop down selector for a particular user group?

    I've been through form customization up and down, media sources, system settings, blahbittyblahblah and nothing I can see to make it happen. I could see it working by adding it to an element category, but without it showing in the element tree I'm not sure how to reference it to make this happen. Am I able to reference this element and set the category with a simple plug-in?
      MODX...the Zen of CMS
      "Bight off more than you can chew and keep right on chewing."
      • 22303 MODX Staff
      • 10,725 Posts
      Not sure what you mean by plugin, but can you not just hide the Category for the particular User Group in the mgr Context? It would only be hidden to that User Group in the Element tree.
        • 39333
        • 151 Posts
        Not sure what you mean by plugin
        I was thinking template 0 could be referenced and category set in a php script on a page load.

        can you not just hide the Category for the particular User Group in the mgr Context? It would only be hidden to that User Group in the Element tree.

        I have done that successfully for all the templates I want hidden from said group, and also completely hid the selector with a second context on for select template resources, but what remains available to the standard manager group is the ability to select template as "empty". Which seems to be template id 0. I'd like to block that selector and remove "empty" from the drop down list completely.
          MODX...the Zen of CMS
          "Bight off more than you can chew and keep right on chewing."
          • 39333
          • 151 Posts
          Can't believe this isn't coming up in any forum searches. Surely many people must remove the empty template option from user groups.
            MODX...the Zen of CMS
            "Bight off more than you can chew and keep right on chewing."
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            There is no "template #0". That designation is a convenience to indicate no template at all. So it's not going to get handled in the way generating the list of actual existing templates is for that select drop-down; it's probably hard-coded somewhere. Between the ExtJS and Smarty used for building the Manager, I haven't been able to find where that select drop-down is actually defined.
              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
              It's definitely generated on the fly. It doesn't exist when OnDocFormPrerender fires. I found its Ext-ID with FF, but I never did find the code that creates it. I also tried to register an OnClick(0) event for the parent, but I think that's still to early for it to exist.

              The only think I could think of was JS code on a timer that continually checks for it and makes it non-visible (and stops the timer) when it's found.
                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
                It's not the end of the world having it there. There are def many positive attributes to letting it stay, especially now. I was just trying to make the end user interace as simple as possible.
                  MODX...the Zen of CMS
                  "Bight off more than you can chew and keep right on chewing."
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Doh, sorry. I wasn't thinking about it being a virtual Template. Can we get a tracker ticket to cover this use case? I'd like to explore the best options for solving this.
                    • 3749
                    • 24,544 Posts
                    Done. Not sure what category you want it in.

                    http://tracker.modx.com/issues/9558
                      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
                      Great! I had touched on it here but I tried to cover too much in this report.

                      http://tracker.modx.com/issues/9537

                      Need to refine my reporting skills, I'll update my issue and link it to the one Bob created.

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