We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41825
    • 16 Posts
    But if you avoid using the Media Source Browser to select the static files, you won't have any of these issues.

    Uhm... so how can I not use the media source browser to select static files? It opens automatically whenever I click on the form field to select a file by default...
    • You can manually edit the field.
        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
        • 41825
        • 16 Posts
        Ah, ok. Thanks for the hint smiley

        So, for further investigation, I placed a file called test.txt in the ModX-root directory, changed the content-type of the static resource to "text" and entered "test.txt" for the static resource's content:

        File / Static Resource: test.txt
        Content-Type: text

        Trying to access this via it's SEO-friendly URL:

        The most annoying thing is that ModX doesn't seem to log an error anywhere, so I've got absolutely no idea, if/where it tries to access the file :-(
        • I just tested the same thing and it worked as expected at the URL of the static resource. I think maybe you are battling some other demons here, but I'm not sure what. Perhaps this is a babel issue?
          • I proposed to modify modStaticResource to conform with the new Media Source handling here http://forums.modx.com/thread/80492/static-resources-and-media-sources#dis-post-443811
              zaenal.lokamaya
              • 41825
              • 16 Posts
              Quote from: opengeek at Oct 29, 2012, 11:05 PM
              I just tested the same thing and it worked as expected at the URL of the static resource. I think maybe you are battling some other demons here, but I'm not sure what. Perhaps this is a babel issue?

              Seems it had something to do with babel. After fiddling with the .htaccess now everything works as expected. I used the default "File System" media-source to select a file which now downloads correctly. However, I want to restrict the filesystem access for my client to specific media sources, so it would be great if static resources would support media sources in future versions.

              Thanks sottwell and opengeek!
              • Is there some fundamental reason why static resources should not be able to use a Media Source? Or is it just a matter of getting the code modified to have them do so? And if it is possible, and reasonable, how would I go about getting such a thing on a fast track? I had thought "Emergency Support", but this isn't exactly an emergency, just something I'd like to get done in the near future, as I have an immediate use case for it.

                I have in mind being able to implement a single corporate-wide document repository, where .pdf and .doc documents will reside. All documents relating to a given product will be listed in a MIGXdb TV using static resources and a custom Media Source into that corporate repository.
                  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
                • Quote from: sottwell at Jan 07, 2013, 01:42 PM
                  Is there some fundamental reason why static resources should not be able to use a Media Source? Or is it just a matter of getting the code modified to have them do so? And if it is possible, and reasonable, how would I go about getting such a thing on a fast track? I had thought "Emergency Support", but this isn't exactly an emergency, just something I'd like to get done in the near future, as I have an immediate use case for it.

                  I have in mind being able to implement a single corporate-wide document repository, where .pdf and .doc documents will reside. All documents relating to a given product will be listed in a MIGXdb TV using static resources and a custom Media Source into that corporate repository.

                  No fundamental reason other than complexity of implementation and it just hasn't been done yet.
                  • So who do I talk to if I want to pay for this to be done? Or am I being presumptuous?
                      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
                    • Quote from: sottwell at Jan 07, 2013, 06:03 PM
                      So who do I talk to if I want to pay for this to be done? Or am I being presumptuous?
                      There are a great number of features I want to get into core this year, including some significant improvements and/or refactorings of Media Sources themselves. At the moment, the implementation of Media Sources is still incomplete within MODX, and in some cases broken. I've been divided on when exactly certain changes to Media Sources would be scheduled (2.3, 3.0, etc.) and am similarly divided on integrating them as they exist into Static Resources for 2.3 as a result.

                      Is the main goal to be able to properly use the Media Source Browser when selecting files for Static Resources or to associate their location with a specific Media Source? If the former, this will require core modification. If the latter, you can easily use a Snippet within the Static Resource path value to prepend a Media Source path or URL, e.g.
                      [[getMediaSourceBasePath]]relative/path/to/file.ext