I am currently trying to create a media source for multiple contexts. Each context has its own cultureKey (de,en,es,ru…).
For each context a folder has been created (assets/de/, assets/en/, assets/es/, assets/ru/).
In the frontend I always get the correct path, because the cultureKey is interpreted correctly. In the backend when uploading the system always accesses the “de” folder.
Here are the media source settings:
basePath: assets/[[++cultureKey]]/
baseUrl: assets/[[++cultureKey]]/
If you’re in the manager then the active cultureKey will be the one in the system settings.
So I don’t think it’s going to work the way you expect unfortunately.
Can you give a bit more information about what you’re trying to achieve with the media source?
Hi @digitalpenguin,
I was afraid that the backend only knows the one key.
I want to create multiple media sources for different areas (slider, gallery, content…). I used Babel for multilingual and so I have 9 contexts for the different languages.
I want to have a different file in the right folder (CultureKey) for each language.
Are you producing and uploading different files for each language? As in the actual photo file for the de slider would be different than the photo file for other language slider? If so, would it be possible to name the files an identical name but with a suffix of the language key; de or ru, etc. And then in the img path use the culture key setting to do the switching? That would allow you to upload them all to just one slider folder I think…
@lucy
Yes, each TV should get its own folder in the folder of the language. Unfortunately, with the suffix the images still end up in one folder. But thanks for the approach!
@bruno17
I have taken information from the MIGX snippet and written the following snippet “backendKey”:
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.