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)
Thx again for the greate addon!
/Mike (biiig fan)
Type: | Discussion |
---|---|
Status: | New |
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:
but i don't know what to replace $field_2_image->src; with
Thanks
In my view.php i've changed this line to create the link:
but i don't know what to replace $field_2_image->src; with
Thanks
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:
Then in your view.php you would do this:
From there you should be able to easily add in any kind of javascript lightbox or whatever.
Good luck!
-Jordan
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:
From there you should be able to easily add in any kind of javascript lightbox or whatever.
Good luck!
-Jordan
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);
Fantastic! Works great thanks!
Here's how the code looks,
controller.php
view.php
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
Thanks, that was very helpful, saved me a lot of time. With this and FancyBox it's easy to make images zoomable :)
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
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
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...