Rollover / hover showing html from caption

Permalink Browser Info Environment
Hi. I really like your plug-in, but when I hover over a thumbnail, the text from the caption shows with the html. Anyway to fix that? Thanks.

Type: Discussion
Status: New
ekw
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hi,
I've just updated the addon to address this issue (version 1.05).

Let me know if you run into any problems or have any other questions.

Thanks!

-Jordan
ekw replied on at Permalink Reply
ekw
thanks for the quick response and fix.
It now doesn't show the caption when I rollover the thumbnail, but I want the caption to display the html correctly BOTH when I rollover and when the image is displayed fully.
Now the full image shows the caption with the html code instead of rendering it appropriately.
Please see this link:http://www.irisquilts.com/index.php/quiltgallery/nature/...

and you'll see what I mean.

Thanks again.
jordanlev replied on at Permalink Reply
jordanlev
It looks like you may have had some customized code in there before which got overwritten during the update (because prior versions didn't allow html in the captions either). Fortunately I just updated the addon (again) with a new feature that lets you enable this -- what you want to do is upgrade your addon to the new new version (1.6) and then add this line of code to your config/site.php file:
define('DELUXE_IMAGE_GALLERY_HTML_CAPTIONS', 1);
ekw replied on at Permalink Reply
ekw
thanks! the caption now shows the html correctly. any idea why nothing shows when hovering over the image?
jordanlev replied on at Permalink Reply
jordanlev
Huh... I misunderstood your original request -- I thought you didn't want those appearing there. The problem is that those little popup things won't show HTML, so the choice is either show them with the html, show them with all of the html tags stripped away (which might make the text not look correct), or not show them at all. I chose what I thought was the lesser of all evils and just removed the display entirely (most people don't like that actually because it gets in the way of the image).
But if you want to add it back with the html tags stripped out you can do so by following these steps:

1) Create a new directory on your server at YOURSITE/blocks/deluxe_image_gallery/ (if it doesn't already exist).

2) Copy this file:
YOURSITE/packages/deluxe_image_gallery/blocks/deluxe_image_gallery/view.php

...into that new directory you just created.

3) Edit that new copy of the file and change line #17 from this:
<a href="<?php echo $img['full_src']; ?>" rel="<?php echo $rel; ?>">

...to this:
<a href="<?php echo $img['full_src']; ?>" rel="<?php echo $rel; ?>" title="<?php echo strip_tags($img['caption']); ?>">


I think that's the best we can do -- let me know how it goes.

-Jordan
adajad replied on at Permalink Reply
adajad
I got the opposite problem though...

In thumbs view the correct alt-tag is shown but in zoomed view the entire html is shown as hover popup, and I can't get rid of it!

My D.I.G is modified quite a bit and I have added a div with caption information as suggested in an earlier thread in this forum (http://www.concrete5.org/marketplace/addons/deluxe-image-gallery/qu... ).

How can I remove that hideous popup with my html??
jordanlev replied on at Permalink Reply
jordanlev
When you say "popup" do you mean the caption itself, or an additional popup that appears when you hover over the image?
adajad replied on at Permalink Reply 1 Attachment
adajad
Ok, I might not have been clear in my previous post. Sorry.

The thing is that everything in my caption <div class="deluxe_image_gallery_caption"> (including html) shows as alt tag for the zoomed image.

But as it happens this seems to be an IE8 issue because it behaves somewhat as it should in Chrome. In Chrome, on the other hand, I don't get the desired alt tag on the thumbs.

I am at home at the moment working over VPN on the server so I don't have all the tools I usually do when I'm on my computer at work. Perhaps I will figure it out tomorrow, but if you have any suggestions then please let me know.

Below is some code from view.php

<?php  if ($enableLightbox): ?>
   <a href="<?php  echo $img['full_src']; ?>" rel="<?php  echo $rel; ?>">
   <?php  endif; ?>
   <?php  echo $html->image($img['thumb_src'], $img['thumb_width'], $img['thumb_height'], array('border' => '0', 'alt' => $img['project'])); 
   <?php  if ($enableLightbox): ?>
   </a>
   <div class="deluxe_image_gallery_caption" style="display: none;">
      <span><?php echo $img['client']; ?>&nbsp;-&nbsp;<?php echo $img['project']; ?></span>
      <br />
      <span>Design: <?php echo $img['design']?>&nbsp;-&nbsp;Construction: <?php echo $img['construction']?></span>
   </div>
<?php  endif; ?>


Edit: Nevermind my stupidity... Alt tags are not supposed to show in browsers except in Internet Exploder (which does everything wrong). The correct use of the desired effect should be title="" together with alt="" (alt for alternative text when images cannot be shown). So now it just seems to be an IE issue with the caption (including html) showing up. See attached jpg.
jordanlev replied on at Permalink Reply
jordanlev
Should be able to remove the alt tag then, so change this line:
<?php  echo $html->image($img['thumb_src'], $img['thumb_width'], $img['thumb_height'], array('border' => '0', 'alt' => $img['project']));

...to this:
<?php  echo $html->image($img['thumb_src'], $img['thumb_width'], $img['thumb_height'], array('border' => '0', 'alt' => ''));
adajad replied on at Permalink Reply
adajad
Nope, the problem still exists in IE (8 and 9) and I can't figure out why.

It seems IE reads the <div> as alt="" and displays it (as it shouldn't) while every other browser (not tested EVERYONE but still) does not.
adajad replied on at Permalink Reply
adajad
OK, I solved it.

I had to edit jquery.fancybox-1.3.4.pack.js to get rid of it. Somewhere in that jungle of code I found:
b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);


and replaced it with:

b("<img />").attr({id:"fancybox-img",src:v.src,alt:""}).appendTo(m);


What this does i setting alt="" instead of alt=title, which IE shows on hover.

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.