Images popup in lightbox style?

Permalink Browser Info Environment
Hi First of All awesome addon!!! Love it! Are using it here on the 6 block on my pagehttp://www.spotonnyc.dk anyways is there a way to get the thumnail pic to popup in a lightbox Luke if u have some product u wanne have people see in a full scale mode?

Thx again for the greate addon!

/Mike (biiig fan)

Type: Discussion
Status: New
mikefatty
View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Hi Mike,
This addon does not have a lightbox feature.
Do you know how to make lightboxes just with regular HTML/CSS/Javascript? If so, I might be able to show you how to modify your block to include that (but it depends on how your lightbox code is set up). Also, would you want the lightbox to show a larger version of the thumbnail image, or a different image altogether?

Note that I also have another free addon called "Zoom Image Dual" which *does* have the lightbox functionality, but it's only the lightbox (it does not let you design the block like you can with Designer Content):
http://www.concrete5.org/marketplace/addons/zoom-image-dual...
prairieland replied on at Permalink Reply
prairieland
I would like to have the thumbnail image link to the larger image also. Doesn't have to be a lightbox, a popup or another page would work also. Any tips on how to get started.

In my view.php i've changed this line to create the link:

<a href="<?php  echo $field_2_image->src; ?>"><img src="<?php  echo $field_2_image->src; ?>" width="<?php  echo $field_2_image->width; ?>" height="<?php  echo $field_2_image->height; ?>" alt="" /></a>


but i don't know what to replace $field_2_image->src; with

Thanks
jordanlev replied on at Permalink Reply
jordanlev
You're going to need to modify the controller so that it generates the thumbnail AND gives you the full-size image (right now the controller will only give you one or the other, so the html you have is only going to link to the thumbnail, not the larger version of the image).

What you want to do is find the line in the controller that calls "$this->get_image_object()", and add another line below it that makes another call to that function but puts the result in a different variable -- for example:
$field_2_image_fullsize = $this->get_image_object($this->field_2_image_fID);


Then in your view.php you would do this:
<a href="<?php echo $field_2_image_fullsize->src; ?>"><img src="<?php echo $field_2_image->src; ?>" width="<?php echo $field_2_image->width; ?>" height="<?php echo $field_2_image->height; ?>" /></a>


From there you should be able to easily add in any kind of javascript lightbox or whatever.

Good luck!

-Jordan
jordanlev replied on at Permalink Reply
jordanlev
Oh, I missed something in my code -- after you assign the full size image to that variable, you need to send it to the view by doing this:
$this->set('field_2_image_fullsize', $field_2_image_fullsize);
prairieland replied on at Permalink Reply
prairieland
Fantastic! Works great thanks!

Here's how the code looks,

controller.php
public function view() {
      $this->set('field_2_image', $this->get_image_object($this->field_2_image_fID, 162, 200, false));
      $field_2_image_fullsize = $this->get_image_object($this->field_2_image_fID);
      $this->set('field_2_image_fullsize', $field_2_image_fullsize);
   }


view.php
<a href="<?php  echo $field_2_image_fullsize->src; ?>"><img src="<?php  echo $field_2_image->src; ?>" width="<?php  echo $field_2_image->width; ?>" height="<?php  echo $field_2_image->height; ?>" alt="" /></a>
Kiesel replied on at Permalink Reply
Kiesel
Thanks, that was very helpful, saved me a lot of time. With this and FancyBox it's easy to make images zoomable :)
mikefatty replied on at Permalink Reply
mikefatty
Thx Jordan

I've havent played so much with "lightboxes" but i understand what u mean, so ill take a look at the Zoom.images dual pic, its was kinda the same question Praireland below wrote i was looking for, so do i go change the view.php file? or am i totaly wront?;-)


Thx

/Mike

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.