Watch tyro work without a net: trying to make my own gallery blocks
Permalink
Okay...so, the problem is, I can't find any gallery add-on that lets you have both vertical and horizontal format thumbnails in the same gallery...most of them allow one or the other, some crop everything to a square. So I'm trying to do it myself, by making a gallery out of a stack, with separate blocks (generated by Jordan Lev's Designer Content...thanks once again, Jordan) for either format. And it works just fine, except that the lightbox effect won't function unless the anchor tag includes the path to the original photo.
This is what the view.php includes:
So long as I have the proper Javascript in the page source, this works: click the thumbnail, and up pops...the thumbnail. That's because I simply copied
into the anchor tag, just to have something to test the function of the lightbox. The problem is: I haven't got the slightest idea how to say, in PHP language, "Go get the URL to the original-size photo that you made this thumbnail from, and put it here."
Does anyone know?
This is what the view.php includes:
<?php if (!empty($field_1_image)): ?> <a class="ccmGalleryImage" href="<?php echo $field_1_image->src; ?>"><img src="<?php echo $field_1_image->src; ?>" width="<?php echo $field_1_image->width; ?>" height="<?php echo $field_1_image->height; ?>" alt="<?php echo $field_1_image_altText; ?>" /></a> <?php endif; ?>
So long as I have the proper Javascript in the page source, this works: click the thumbnail, and up pops...the thumbnail. That's because I simply copied
<?php echo $field_1_image->src; ?>
into the anchor tag, just to have something to test the function of the lightbox. The problem is: I haven't got the slightest idea how to say, in PHP language, "Go get the URL to the original-size photo that you made this thumbnail from, and put it here."
Does anyone know?
No, that gives me a 404 error:
$field_1_image is how Designer Content refers to the image chosen from the file manager and converted into a thumbnail. My problem is, the system "knows" what photo to find, since it's just done the conversion process...but I don't know how to tell it, "Look, you just did this. It's the same photo, okay? Just get the big one."
/scenic/stdClass Object( [src] => /scenic/files/cache/804bc4ef9b11bc32d2c92d61c88321bb.jpg [width] => 199 [height] => 133)
$field_1_image is how Designer Content refers to the image chosen from the file manager and converted into a thumbnail. My problem is, the system "knows" what photo to find, since it's just done the conversion process...but I don't know how to tell it, "Look, you just did this. It's the same photo, okay? Just get the big one."
do a print_r($field_1_image); to see if the url to the original can be found in there (perhaps $field_1_image->url)