We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I want to achieve the below functionality. But before I begin I want some of the MODx pros on the forum to advice on what they think is the best approach and set of Snippets/Plugins (existing/custome) it will require.

    Here is the expected functionality:
    a) Create a document area for specific documents which will be accessible to a single UserGroup.
    How can you use the same registration form to add users to UserGroups related to their role on the site. Say you have a group for Editor, another for Partners, another for Authors?

    How do you redirect direct usergroups to dirrefent pages of the site when they log in?

    Partners UserGroup will access (to download) the document area on the Frontend. Editors can use either the frontend or the manager to upload documents.

    b) Provide the ability to forward notification (automatically) emails of new and updated document uploads to the Partners.
    c) Allow Editors the power to upload or replace documents to the specific area of the site.
    d) Permit Editors the right to attach descriptions to documents uploaded.
    e) Enable document search so Partners can search for specific documents when the list become very lengthy.

    Appreciate your time and suggestions.
    [ed. note: ojchris last edited this post 10 years, 7 months ago.]
      • 3749
      • 24,544 Posts
      a) is just a matter of setting up the Resource Group ACL entries for the User Groups.

      I think redirecting them based on user group could be done in a Login postHook.

      The FileUpload snippet, placed on protected pages should handle the uploads.

      b) I think this would take a custom snippet.

      c) Should be covered by a.

      d) not sure about this one

      e) Lots of different ways to do this -- There is already a search bar for the Resource Tree and the System Settings grid. You could do something similar with an ExtJS/modExt tree or grid.

        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'm building exactly the same system for support documents and software downloads.

        You'll need two user groups and one resource group,

        1. Partners, with only web context permsissions.
        2. Editors, with web and mgr context permissions.
        http://bobsguides.com/revolution-permissions.html

        1. Downloads, connected to Partners to enable Partners user access

        Use Static Resources to represent each file. Your Editor user can select a Media Source and upload the files as he creates the Static Resource pointing to it. He can also set its Content Type and Content Disposition.

        Create custom Content Types, and have the Static Resources use the appropriate type and the "attachment" Content Disposition.
        http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/structuring-your-site/resources/content-types
        http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/structuring-your-site/resources/static-resource

        Static Resources have all the fields of ordinary resources (pagetitle, longtitle, summary, etc) as well as Template Variables, so they can be tagged and searched via those fields. They can be listed with Wayfinder or getResources like any other group of resources. A nice scrolling "What's New" box on the home page maybe? They can also be assigned to a Resource Group that is connected to the Partners user group, so only Partner members can access them.
        http://rtfm.modx.com/revolution/2.x/administering-your-site/security/resource-groups

        A plugin can be used on publishing or saving the new Static Resource to send out the notification emails to everyone in the Notify group (users can belong to more than one group). The Notify plugin could modified to trigger automatically on publishing or saving. You can also use it to automatically post to Twitter and/or Facebook or any other social media service, and generate an Atom or RSS newsfeed.
        http://rtfm.modx.com/revolution/2.x/developing-in-modx/basic-development/plugins
        http://modx.com/extras/package/notify
        http://modx.com/extras/package/modxtweeter

        As far as front-end addition of Static Resource and uploading the files, while that can be done with something like NewsPublisher, I prefer to have my site managing users know they are in the Manager and perhaps pay more attention to what they're doing. The Manager can be customized to hide and show only the functionality the user needs. Actually, you could even use a MIGXdb Custom Manager page for handling these, and hide just about everything else from the Editor users.

        While Static Resources don't fully work with Media Sources, they will use a Media Source when selecting the area to select their files from. The file manager that is opened is the usual File Manger popup, and it does work with Media Sources, so you can upload to it and select from it. The Static Resource won't prepend the Media Source's configured paths and URLs, so I've used a chunk that gets prepended to the path that the Static Resource does pick up - [[$path]]documents/thesedocs/thisdoc.pdf. I am also keeping these files in a directory structure outside of the web root, so they cannot be accessed for download except via their Static Resources and the Media Source in the File Manager.




          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
        • Bob and Sottwell. I wish there was a better word than 'thank you'. You both have brought clarity to the process. Lucky to have Sottwell's exact experience. Truely grateful.
          • The site I'm working on is still in development, so I'll probably end up with better automation of the entire process. For example, instead of requiring the user to add the chunk to the path for the Static Resource, I can use a plugin to either add the chunk on save, or on doc parsing.

            I don't want to save the resource with the entire path hard-coded, because then I'd be stuck if that Media Source path was ever changed. So it's better to have a chunk with the same path as in the Media Source, so it can be edited if the Media Source ever changes.

            Now if Static Resources were modified so that they would be able to store their Media Source ID, then use that when being parsed...hmm. A plugin should be able to take care of that. Use a TV (hidden, maybe?) with a default value of the Media Source's ID, and fetch that Media Source's path to prepend to the static resource's content on page request.
              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 see. I had this experience with Media Sources recently. Nice workaround.

              You mentioned
              Static Resources have all the fields of ordinary resources (pagetitle, longtitle, summary, etc) as well as Template Variables, so they can be tagged and searched via those fields. They can be listed with Wayfinder or getResources like any other group of resources.

              How would you use Wayfinder with a required tpl like this:
              <tr class="row">
              <td width="9%">1.</td>
              <td width="64%"><p>[[+introtext]]</p></td>
              <td width="27%"><p><a href="[[~[[+id]]]]">Download</a> (<img src="/filepath/images/pdficon_small.gif" height="17" width="17" class="icon" alt="pdf icon" /> 
                PDF, [[+tv.docpages]] pages - [[filesize?&file=`[[+content]]`]])</p></td>
              </tr>


              Is that possible for Wayfinder (with all the TVs)?
              • The only problem I see is that Wayfinder doesn't do content, but you can take care of that by installing the FastField plugin and using this:
                [[filesize?&file=`[[#[[+id]].content]]`]])</p></td>

                FastField is rapidly becoming one of my must-have addons. http://modx.com/extras/package/fastfield
                  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
                • So I would then have:

                  <tr class="row">
                  <td width="9%">1.</td>
                  <td width="64%"><p>[[+introtext]]</p></td>
                  <td width="27%"><p><a href="[[~[[+id]]]]">Download</a> (<img src="/filepath/images/pdficon_small.gif" height="17" width="17" class="icon" alt="pdf icon" />
                    PDF, [[+tv.docpages]] pages - [[filesize?&file=`[[#[[+id]].content]]`]])</p></td>
                  </tr>
                  • Hello. Project is sailing!
                    I'm trying to use Wayfinder to generate links to the static resource.

                    I have a resource parent resource 'PartnerDocuments" (say id 7) and it has two child static resource documents (say id 8 and 9). I want to output the Wayfinder links on the PartnerDocuments resource.

                    Since the page template already has a Wayfinder call, is there a special approach to making the second wayfinder (place in a chunk that is set in the content area of the PartnerDocuments resource) work. For now I'm not getting any output.

                    Here is my call:

                    [[!Wayfinder?
                    &startId=`7`
                    &outerTpl=`DocDownloadMenuOuter`
                    &rowTpl=`DocDownloadMenuRow`
                    &innerTpl=`DocDownloadMenuOuter`
                    &innerRowTpl=`DocDownloadMenuRow`
                    &hereClass=`active`
                    &firstClass=`first`
                    &lastClass =`last`
                    &parentRowTpl=`` 
                     ]]
                      • 4172
                      • 5,888 Posts
                      are your Resources perhaps hidden from menu (hidemenu=1)?
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!