modxcms/revolution — pull request #236 by Bruno17 (2011-12-04 21:39:16+00:00)
Title: dynamic MediaSources with processed placeholders (resource-ID) in pathes

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 only the image-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).

We could add a 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.

I will do so also for MIGX.

Hopefully something like this will make it to the pl.

Thanks!