Collections Image Renderer not showing Images using a custom Media Source

In the Collections addon if I try to add an image field that uses a custom media source it fails to render the image. Is three a collection setting for this or a work around?

There is a system setting collections.renderer_image_path that you can use.

Maybe this can help:

I think that would affect all collections though which wouldn’t work if that was the case.

Yes this affects all columns using the Collections.renderer.image renderer.
If you already use this renderer for other collections, you have to create a custom renderer or a renderer snippet.

I was able to get it working with this code, running as a snippet renderer, that spits out the proper restored URL paired with the native Collections.renderer.image renderer to generate the final image.

<?php
use MODX\Revolution\modTemplateVar;
use MODX\Revolution\Sources\modMediaSource;
$imgName = $modx->getOption('value', $scriptProperties, '');
$tvName = $scriptProperties['column'];
$tvName = substr($tvName, 3);
$tv = $modx->getObject(modTemplateVar::class, ['name' => $tvName]);
$tvMediaSourceId = $tv->get('source');
$mediaSource = $modx->getObject(modMediaSource::class, $tvMediaSourceId);
$mediaSourceProperties = $mediaSource->getProperties();
$mediaPath = $mediaSourceProperties['basePath']['value'];
if ($imgName) {
    // Build a purely relative path for pthumb
    $relativePath = ltrim($mediaPath, '/') . ltrim($imgName, '/');
    $thumb = $modx->runSnippet('pthumb', [
        'input' => $relativePath,
        'options' => '&h=90&q=75'
    ]);
    
    // Strip the leading slash off the pthumb result. 
    // Collections.renderer.image will add its own '/' in the grid.
    return ltrim($thumb, '/');
}
else {
    return '';
}