I wanted automatic thickbox creation for resized images, so I added it. There is a check box in the format configuration to set whether thickboxes should be created. With FCKeditor, IMCE, Thickbox, and the style css patch that I submitted yesterday, thickbox linked thumbnails is really simple. I am sure that more options could be added to it, but it seems to work correctly now.

Comments

quicksketch’s picture

I'm very anti-thickbox. This filter should be added to the thickbox module, rather than Image Resize Filter (since it doesn't have much to do with resizing images at all). Since I prefer to avoid thickbox at any cost, I'd prefer not to have to maintain a feature requiring it.

13rac1’s picture

Version: » 6.x-1.0

Do you dislike all JS boxes? I'd write it for a different box. Thickbox was just the one that my client liked the best. I suppose that I could rewrite your module for the Thickbox module. It would require duplicating most of your code though. Is that fine with you?

My client liked thickbox, but didn't understand linking to both versions of the image and changing the class. I saw no reason that they had to do that, so I wrote the patch.

grosbedos’s picture

Wow, thanks for the module, and thanks for this patch, it's exactly what i need.
Patch works, and is easily portable to lightbox, it's what i have done, perfect!

quicksketch’s picture

As a compromise, could we potentially add a "rel" property containing the original image path (since it's still valid HTML) that contains the path to the original image? Then you could easily locate images that contain "rel" attributes and then add thickbox to those elements. It'd be a helpful property to have anyway, and it wouldn't be hard-coded to be thickbox specific.

13rac1’s picture

Hmm.. except then it would require module users to write Javascript or another filter for the functionality to work.

What about options to wrap the image tag in anchor tag linking to the original image path, plus two options to apply classes to both the anchor and the image tags? Those three options would open up customization choices, plus would support thickbox/lightbox without specifically supporting them.

quicksketch’s picture

Now we're talking! Those sound like killer configuration options.

[ ] Link to fullsize image when image is resized

Class to apply to image link:
[                               ]

I'm not sure why we need the class on both the image and on the link. Seems like it's silly to put a class on the image when it'll be the only item inside of the link (and the link would imply the image was resized).

We might run into some problems where this will take effect everywhere on the site, rather than affecting some resized images but not others. It's also worth noting that right now our filter options are universal, which we'd probably want to switch to be per-input format so that you could have one format that links but another one that doesn't.

quicksketch’s picture

Status: Needs work » Fixed
StatusFileSize
new7.01 KB

Okay, here's the implementation I've come up with. I've added options for "Add a link" and "Link class", and a bit of theming and JavaScript to tie things together. I tested it out with thickbox and seems to work just as expected. I've already committed these changes (I'm trying to get out a 1.1 release), but please let me know if more flexibility is needed in the implementation.

quicksketch’s picture

Title: Add thickbox to resized images » Add a Link to the Original Image (work with Thickbox)
13rac1’s picture

That works exactly as I would like.

A minor issue: When you go back to the page, if the "Add a link" checkbox is checked, the "Link Class" text isn't visible until you uncheck and recheck.

quicksketch’s picture

Oh hmm. It should. At least it works for me in Firefox/Safari. What browser are you using?

13rac1’s picture

Odd... I checked again. Now it isn't doing it. I am using FireFox 3.0.6. Well, never mind then.

quicksketch’s picture

Awesome. :)

13rac1’s picture

Status: Fixed » Closed (fixed)