Based on what I’ve found in the forums or reading the docs it seems like you should be able to set a different media source for each context:
This works perfectly with template variables but in the main rich text editor window if you add an image (or link) the resource browser loads the directory that is associated with the “default_media_source” in the main “System Settings” (it ignores the context setting). I’ve tested this with both CKEditor and TinyMCE and neither work.
The URL that is called for the resource browser popup looks like this:
So the “source” media id is being recognized correctly (source=3) but this isn’t being passed to the directory listing script:
/connectors/browser/directory.php?action=getList&id=/ (POST value has source=1)
After some digging and experimenting with the source code I think that both editors are using an old URL parameter. If you call the resource browser with the following the context media source loads correctly:
So as a fix I made the following changes:
Line 207 change to
MODX 2.2.10 core files
filebrowserBrowseUrl: MODx.config['manager_url'] + 'index.php?a=' + MODx.action['browser'] + '&source=' + MODx.config['default_media_source'] + '&ctx=' + MODx.config['wctx'], // TODO !!!
Line 53 change to:
'resource_classes' => $resourceClasses,
'wctx' => $workingContext->get('key'),
The only issue with these changes is that they will break once MODX is updated (I'm guessing the "&source=" URL parameter used to work but was recently deprecated?).