How can I set a gallery specific media source, path, or other option?

On the Settings tab of a resource you can set the Media Source, Relative URL, Content Position, Crops and Custom Fields.

By default all of these are set to "inherit", which makes it read the appropriate values from the context or system settings. After changing a value, it may be necessary to reload the page for changes to take effect.

It's not currently possible to change those values for newly created resources out of the box. It's possible to use a MODX plugin to set specific values, for example with the following plugin (set it to the OnDocFormRender event):

$parent = $resource->get('parent');
if ($parent == 2) {
   $resource->setProperty('custom_fields', '{"class":{"label":"Slide> Type","type":"select","options":[{"value":"","label":"All> Devices"},{"value":"desktop-only","label":"Desktop> Only"},{"value":"mobile-only","label":"Mobile> Only"},{"value":"text-slide","label":"Text Slide"}]}}', 'moregallery');

Still need help? Send us an email Send us an email