modxcms/revolution — pull request #238 by Bruno17 (2011-12-07 13:14:19+00:00)
Title: dynamic Mediasources with autocreate Directory option for image and file-TV

Signed-off-by: Bruno Perner

now again, a clean pull request.

Signed-off-by: Bruno17

Would be nice, when we could have something like this.
Dynamic Mediasources.

For Example different filepathes for each resource.

I added a function 'processPlaceholders' to modMediaSource and added the resource-id as placeholder to processors, which are using mediaSources.

modified the image-TV and file-TV (and MIGX) to try this functionality, which seems to work well.

With this we can have mediaSource-pathes like:

assets/images/[[+mediasource.res_id]]/

or

assets/files/[[+mediasource.res_id]]/images
assets/files/[[+mediasource.res_id]]/pdfs

Also using snippets like ultimateParent or getResourceField for example or outputFilters to manipulate the mediaSource-pathes depending on the resource should work (didn't test that yet).

Added also an option to file- and image-TVs where they create resourcefolders automatically, depending on its dynamic mediasource - of course only possible, once the resource was created.

Hopefully something like this will make it to the pl.

Thanks!