While waiting for a reply about my user permissions problem maybe I can help you out or at least give you another suggestion to think about (without worrying about custom TVs to get your images up). I needed to get a gallery on the page and wanted a way to load the photos automatically so the client can just upload the photos to a folder and not worry about putting them on the page or assigning individual photos to separate TVs. It’s easy.
Make space for the gallery on your page template. I want the photos to line up in two columns in a sidebar on the right but have the first photo double width, so I deal with that separately (and I have decided that that photo will always be called main.jpg (the main photo in the folder)). So in the template I put this:
<div id="gallery">
<ul><li><a href="photos/[[*photofolder]]/main.jpg"><img class="galleryphotobigger" src="photos/[[*photofolder]]/main.jpg" alt="[[*pagetitle]]" /></a></li>[[!gallerylist?&dir=`[[*photofolder]]`]]</ul>
</div><!-- end gallery -->
There I have one TV called photofolder which the client uses to specify the name of the folder with the photos for the gallery on this page (the folder is always a child of the parent "photos" folder). The rest of the items in the list are created by the gallerylist snippet. The name of the directory that the snippet will have to look for is passed to it in the dir variable.
Here’s the little snippet which finds the photos and loads them via a chunk:
$findme = 'main';
$files = glob('photos/' . $dir . '/*.*');
$output = '';
for ($i=0; $i<count($files); $i++)
{
$photo = $files[$i];
if(strpos($photo, $findme) === false) {
$output .= $modx->getChunk('fullgallerychunk', array(
'filename' => $photo,
));
}}
return $output;
My knowledge of PHP is utterly basic so that might not be the best way to do the job, but it works. It lists all the files (there must only be image files in the folder) except for the file entitled main.jpg. It outputs the name of the file to the filename placeholder in the chunk.
Then you just need a tiny chunk for the images, like so:
<li><a href="[[+filename]]"><img class="galleryphotosmall" src="[[+filename]]" alt="[[+filename]]" /></a></li>
I hesitate to recommend stuff because I haven’t yet succeeded in getting my first Modx site off the ground, but I have got a little gallery going (and I like the Pirobox JQuery lightbox, which is so easy to plug into the above).
Any good?