We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi,
    Lets say my resource structure is like

    web
    >parent1 [container]
    .....>>parent2 [container]
    .......>>resource1
    .......>>resource2
    >resource3
    ....


    and my img field in migx is set to use assets/uploads/ as its media source destination. Let's say I have sub-directories under uploads like 'dept1' and 'dept2' which also store images. I want my 'sales' user group to be able to upload to dept1 directory only and my 'service' user group to be able to upload dept2 directory only. I can achieve this user group to media source association in the modx dashboard files tree but how do i achieve this view in the file manager that pops when I try and add an image via migx? It shows all the sub-directories in uploads and I'm trying to avoid that.

    Thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Instead of using "inputTVtype":"image" you need to create an image TV with the Media Source you want, and use "inputTV":"yourImageTV".
        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
        • 4172
        • 5,888 Posts
        or you can do all the configurations for your MIGX-TV with the MIGX-CMP.
        Then you can add mediasources to inputTVtypes.

        Its also possible with the json-configuration, but thats a bit a complicated json-string then
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 12410
          • 353 Posts
          Ok thanks guys. Is there a good video/tutorial on Migx CMP? My brain gets a bit baffled with it.
          So if I have ten departments using the same template that would suggest I'd need 10 Migx TVs applied to the same template with their image fields using the corresponding media sources. Doesn't it? Ideally I'm looking for the view in the modx file browser to adjust according to logged in user. I can do it with the dashboard files tree but the modx browser files tree is problematic.
          Thanks! [ed. note: howster last edited this post 12 years, 4 months ago.]
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Hm. Yes, that's a different story. However, I do know that a media source's path and URL can be set dynamically according to the user. Now if I can just remember where that is...
              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
              • 12410
              • 353 Posts
              Possibly something like this? http://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader#MIGX.Useresource-specificmediasourceandmultifile-uploader-Createthedynamicresourcespecificmediasource
              Yes the dynamic resource would be great. Perhaps the dynamic directory could be assets/uploads/[usergroup] if you understand me. Thanks
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                That's probably what I was thinking of. Looks like the {id} is the resource ID, available to MODX as part of the Manager. I'm not sure if a snippet would work, something like assets/resourceimages/[[usergroup]]/, where the usergroup snippet would get the current user's primary group.
                  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
                  • 4172
                  • 5,888 Posts
                  Quote from: sottwell at Jun 07, 2014, 08:44 AM
                  That's probably what I was thinking of. Looks like the {id} is the resource ID, available to MODX as part of the Manager. I'm not sure if a snippet would work, something like assets/resourceimages/[[usergroup]]/, where the usergroup snippet would get the current user's primary group.

                  snippets are working in the media-source - url and path - settings.
                  So, this should work.
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 12410
                    • 353 Posts
                    Hi,
                    I did the tutorial at http://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-mediasource-and-multifile-uploader#MIGX.Useresource-specificmediasourceandmultifile-uploader-Createthedynamicresourcespecificmediasource to "Create the dynamic resource-specific media source" but the 1 directory doesn't get created automatically eg assets/resourceimages/1
                    Error states "the specified directory doesn't exist". Is the intention that i create this 1 directory manually and set the chmod to 777. The directory 'resourceimages' is 777 already.
                    Thanks [ed. note: howster last edited this post 12 years, 4 months ago.]
                      • 4172
                      • 5,888 Posts
                      the directories should be created automatically, of course.

                      what happens, when you remove the resourceimages - directory and create it again, not via ftp, but via the MODX-filemanager (755)
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!