Add pop-up pro to the designer content how?

Permalink Browser Info Environment
The question is in the themen how can i add pop-up pro to designer content...

Type: Discussion
Status: New
bukus9
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Sorry, I do not know what pop-up pro is. Is it another block? If so, it's not possible to combine the two.
But you could use a javascript lightbox / popup plugin (for example,http://fancybox.net ) and add that in to your custom block after you've created it with Designer Content. Take a look at the code of my free "Simple Image Gallery" addon to see how I've integrated the Fancybox effect into the block there, then apply that to the images in your custom block. You might also find this tutorial helpful:
http://c5blog.jordanlev.com/blog/2011/12/build-a-slideshow-block/...
Veronikan replied on at Permalink Reply
Veronikan
I don't see how this is possible. For instance, I can place a thumbnail image through designer content, I can wrap it in an a tag, assign that tag a class, but I can't feed it the image's url without some php. (Unless I can predict the image the client will enter).

What am I missing here?

I do like this add-on very much. I am using it to create a series of specially styled divs, each one containing an image (which is shrunk to thumbnail size via responsive techniques) and some specific text and links. However, I need to be able to allow the viewer to enlarge the thumbnail images. I'd love for them to expand via lightbox.

Does anyone know of a lightbox script that doesn't require link tag wrapping, that targets all images within certain divs?
jordanlev replied on at Permalink Reply
jordanlev
Every lightbox effect I've seen works this way: it outputs a thumbnail in an <img> tag, then wraps that in a link to the full-sized image. To achieve this with a Designer Content block, you need to edit your block's controller.php, find the view() function, and find the line of code that is generating the image thumbnail -- it should look something like this:
$this->set('field_1_image', (empty($this->field_1_image_fID) ? null : $this->get_image_object($this->field_1_image_fID, 300, 200, false)));

This code sends the thumbnail image to the view, and what you want is an additional full-size image (so your view will have one thumbnail image for the <img> tag and another full-size image for the <a> tag). To do that, add this new line of code directly below the existing one:
$this->set('field_1_image_full', (empty($this->field_1_image_fID) ? null : $this->get_image_object($this->field_1_image_fID, 0, 0, false)));

You might need to change the exact names of the fields in there (depending on how your custom block was built), but basically you are copying the existing line, then pasting and changing the new copied line by appending "_full" to the variable name being set, and then changing both numbers to 0.

Now in your view.php file, you can do something like this:
<a href="<?php echo $field_1_image_full->src; ?>" rel="fancybox">
  <img src="<?php echo $field_1_image->src; ?>" width="<?php echo $field_1_image->width; ?>" height="<?php echo $field_1_image->height; ?>" alt="" />
</a>


Hope that helps!

-Jordan
Veronikan replied on at Permalink Reply
Veronikan
Thanks Jordan! I will bookmark this.

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.