Set a different default media source for resources in a collection


We would like to have a default media source if a child’s parent is x.

Step to reproduce

Not so much a bug, it’s just the default media source is set globally via system settings.

Observed behaviour

The default media source is set globally via the system settings.

Expected behaviour

To be able to set the default media source via the parent / individual resource.


MODX 2.8.4

I don’t think there is such a concept as a media source for a resource in MODX.
A media source can be defined for a TV but not for a resource.

Maybe create special TVs with the correct media source for the template you use in your collection.

I thought this might need to be the solution. The issue is the children are set up as a Static Resource, where the content field appears to be the file.

So this media source would be to select the file of a static resource and not for a TV?

Yes that’s correct. -

something like that would maybe possible with a MIGXdb TV grid instaed of a collection and file TV inputtype for the content field with a dynamic path in the mediasource

The only way to achieve this, that I can think of, is to create a custom plugin (event = “OnManagerPageBeforeRender”) that adds some code to override the component MODx.panel.Static with Ext.override and changes the function “getMainFields” to add a source-parameter.

Ext.override(MODx.panel.Static, {
	getMainFields: function(config) {
		var its =,config);
			xtype: 'modx-combo-browser'
			,source: 3 //add the desired media-source-id
		return its;

I’m not sure I would recommend such an approach though.