OMG this is so exciting I actually clocked out of work to post this! :P
- Sort and organize images,
- Store image attributes in a custom database,
- Dynamically render those values in fully customizable output, and
- Do a whole lot of other things with your images...
The one limitation you might have come across in templating Gallery's output, is the lack of support for the
&outputSeparator property. For those of you familiar with the venerable MODX Snippet getResources you'll know that
&outputSeparator is super-handy. With Gallery you're often rendering a JSON array for a JS gallery plugin, and you need
&outputSeparator to delimit objects. Well as of yet Gallery doesn't do this out-of-the-box.
This requires modification of the Gallery snippet itself, so I recommend making a copy of it - that way you remove it from the upgrade path and retain a copy of the original snippet. I called my duplicate "GalleryOutput" and will use that name to call the snippet in my chunks & templates, etc.
Edit your duplicate Gallery snippet, and line 132 you'll see this:
*UPDATE: surely line numbers have changed since this post.
$output = implode("\n",$output);
Replace that with this:
$outputSeparator = $modx->getOption('outputSeparator', $scriptProperties, "\n"); $output = implode($outputSeparator, $output);
Then you can use your duplicate Gallery snippet like this:
[[GalleryOutput? &albums=`albumName` &thumbTpl=`myCustomJSONTpl` &outputSeparator=`,`]]
When you upgrade the Gallery component, it will overwrite the Gallery snippet, but not your clone, so you can manage the upgrade manually. Actually in a near future release this will be included by default apparently ;). That's it, have fun with MODX!