-
☆ A M B ☆
- 24,524 Posts
I am having the same problem with a static resource created directly from the Tree. If I manually add the ../home/pdf/ to the filename, then it works.
[ed. note: sottwell last edited this post 13 years, 11 months ago.]
I think the file-browser doesn't know, you are selecting the file for a static Resource or the static Resource doesn't know you have selected a file from file-browser by using a (custom) mediasource.
I think there isn't a setting or something where you can connect a static resource to a mediasource.
Or do I miss something?
-
☆ A M B ☆
- 24,524 Posts
Somewhere in the process the path from the media source is being dropped in the case of the PDF media source. When I select a file from within the web root, the entire path is in the form field. But when I select from the PDF media source only the filename is shown.
[ed. note: sottwell last edited this post 13 years, 11 months ago.]
-
MODX Staff
- 10,725 Posts
Static Resources are not Media Source aware currently. This is completely dependent on the logic I mentioned earlier regarding components_path and resource_static_path Settings.
[ed. note: opengeek last edited this post 13 years, 11 months ago.]
isn't this the way how the filebrowser is working, when selecting a mediasource?
As soon as you select a file from filebrowser and you have selected a medisource, which points to another path than the web-root, it does return the filepath starting from mediasource-path.
The static Resource needs to know somehow, from which mediasouce you have selected the file.
-
☆ A M B ☆
- 24,524 Posts
It obviously is aware of the default Filesystem source, since if I use that one it does add the full path to the filename when selected.
-
MODX Staff
- 10,725 Posts
I believe the File Browser only works with Static Resources if using the default media source by accident, i.e. this is a major bug in the integration of the File Browser with Static Resources. Trying to use other configurations likely will not work. But that said, and File Browser integration bugs aside, Static Resources themselves ONLY respect paths that are absolute or are relative to the Settings I am describing above.
-
☆ A M B ☆
- 24,524 Posts
So if I create a setting, static_resource_path, then I should be able to use a Media Source that uses the same path?
-
MODX Staff
- 10,725 Posts
To an extent. I just added one for my Assets media source, which is set to my assets path using the relative path/url settings and was able to select a file properly from the Media Browser.
And the path setting is resource_static_path (and element_static_path), not static_resource_path.
-
MODX Staff
- 10,725 Posts
Also, the resource_static_path defaults to the MODX_BASE_PATH, unlike element_static_path, which defaults to components_path or MODX_CORE_PATH . 'components/'.