I solved this in the following way. No idea how good this solution is, at least it works for me.
[[!Gallery? &toPlaceholder=`gallery` &thumbTpl=`getImageProperties`]]
[[+gallery]]
Create Chunk getImageProperties:
[[!getImageProperties? &album=`[[+album]]` &filename=`[[+filename]]`]]
Create Snippet getImageProperties:
<?php
/**
* PROPERTIES:
*
* &album required
* &filename required
* &gallerypath optional. Default: assets/gallery/
*
* USAGE:
*
* [[!getImageProperties? &album=`[[+album]]` &filename=`[[+filename]]`]]
*
*/
$album = $modx->getOption('album', $scriptProperties);
$filename = $modx->getOption('filename', $scriptProperties);
$gallery_path = $modx->getOption('gallerypath', $scriptProperties, 'assets/gallery/');
if (!isset($scriptProperties['filename']) || !isset($scriptProperties['album'])) {
$modx->log(modX::LOG_LEVEL_ERROR, '[getImageProperties] missing required properties &album and/or &filename!');
return;
}
$image = $gallery_path . $album . "/" . $filename;
$tpl = $modx->getOption('tpl',$scriptProperties,'exceptionAlbumTpl');
$output = $modx->getChunk($tpl,array('full_image' => $image));
return $output;
Create Chunk exceptionAlbumTpl and if necessary, adjust the path to the gallery files:
<a title="[[+name]]" href="assets/gallery/[[+album]]/[[+filename]]">
<img class="albumItem" src="[[+full_image]]" alt="">
</a>