Image Sizer Redux: using with dynamic image loop
I am building a page with a lightbox-type display of images. These images are being loaded dynamically from an array (created from a recordset), allowing new images to be added or exitings ones to be edited/deleted by the client. The relevant code for the loop that places these images on the page is -
<?php foreach ($galleryRecords as $galleryRecord) { ?>
<li><a href="_img/gallery/<?php echo $galleryRecord['filename']; ?>" class="p7lsm_type_img"><img src="_img/gallery/<?php echo $galleryRecord['filename']; ?>" alt="<?php echo $galleryRecord['alt']; ?>" height="240"></a></li>
<?php } ?>
Note that each image is within a list element.
To use Image Resizer with this arrangement, would I just surround this loop with the appropriate resizer markup (taken from a dummy page)? For example, place this BEFORE the start of the loop -
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1343773049107
ob_start();
?>
and this after the end of it?
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "_img/scratch/New folder", "proportion", "", false));
} // End Cached Resized Image: ImageCacheInstance_1343773049107
?>
(of course, I'd place the include at the top of the page)