We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • The Collections extra is an excellent way to organize your resources, much like Articles organizes its resources, hiding them from the Tree and providing a grid for adding and editing resources in the Collection's resource.

    Since a Collection's resources are managed from within the Collection's resource, there is opportunity for even better control of user access to the Manager. A simple HTML-type Dashboard Widget can be created with nothing more than a link:
    <a href="[[++manager_url]]?a=resource/update&id=5">Cute Kitty Blog</a>

    Add the widget to the dashboard, and your blog editors don't even need to view the Tree at all!

    If you have several Collections, and several different groups to manage them, Dashboard Widgets can also be PHP code, or link to a snippet. That PHP code can output only the links appropriate for the user's group.

    Create a custom Dashboard for your editors with only the widgets they will need to see when they log in for a really customized user interface.
      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
      Nice.

      Have you converted an Articles blog to Collections?
        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
      • I haven't touched Abomination Articles for over two years.

        Making pretty buttons for the Collections links in a dashboard widget, I learned something very interesting about templates for the Manager.

        Here's the HTML code for a single button in Revo 2.3.1
        <table cellspacing="0">
        <tbody>
        <tr class="x-toolbar-left-row">
        <td class="x-toolbar-cell">
        <span class="x-btn x-btn-small x-btn-icon-small-left x-btn-text bmenu x-btn-noicon" unselectable="on" style="width: auto;">
        <em class="">
        <button class=" x-btn-text" type="button" onclick="EditCollection(3)">Button Text</button>
        </em>
        </span>
        </td>
        </tr>
        </tbody>
        </table>
        


        and here's the same for Revo 2.2.14
        <table class="x-btn x-btn-noicon x-btn-over" cellspacing="0" style="width: auto;">
        <tbody class="x-btn-small x-btn-icon-small-left">
        <tr>
        <td class="x-btn-tl">
        <i> </i>
        </td>
        <td class="x-btn-tc"></td>
        <td class="x-btn-tr">
        <i> </i>
        </td>
        </tr>
        <tr>
        <td class="x-btn-ml">
        <i> </i>
        </td>
        <td class="x-btn-mc">
        <em class=" x-unselectable" unselectable="on">
        <button id="ext-gen116" class=" x-btn-text" type="button" onclick="EditCollection(4)">Button Text</button>
        </em>
        </td>
        <td class="x-btn-mr">
        <i> </i>
        </td>
        </tr>
        <tr>
        <td class="x-btn-bl">
        <i> </i>
        </td>
        <td class="x-btn-bc"></td>
        <td class="x-btn-br">
        <i> </i>
        </td>
        </tr>
        </tbody>
        </table>


        The javascript function is just a simple forwarder
        <script type="text/javascript">
            function EditCollection(c){
                var collection = c;
                // make it ?a=30&id= for Revo 2.2.14
                window.location = "[[++manager_url]]?a=resource/update&id=" + collection;
            }
        </script>



        [ed. note: sottwell last edited this post 9 years, 9 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
        • I'm including the exported Policy Template and Access Policy I worked out for editor users. It works well for me for limiting editors to exactly what they need to be able to do. YMMV.

          Import the template, import the policy. Create a group using the policy. Create users to add to the group.

          I used SuperUser (0) role in every case, but then I can't make heads nor tails of Roles.
            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
            You could look at the the video of my MODX security presentation at MODXpo, but I'll save you the trouble. wink

            In it, I recommended using the same role number for everyone who isn't a super user (e.g., 15).

            Roles in Revo are mainly useful only if you need to have users in the same User Group with different capabilities. As long as you put such users in different User Groups, their roles are irrelevant. Putting them in different groups makes things much easier to set up and manage, and greatly simplifies diagnosing permission problems, imo, with the bonus that you never have to even think about roles.

            It sounds like you're doing it that way already.



              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