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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | image_resize_filter_link.patch | 7.01 KB | quicksketch |
| add_thickbox.patch | 2.96 KB | 13rac1 |
Comments
Comment #1
quicksketchI'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.
Comment #2
13rac1 commentedDo 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.
Comment #3
grosbedos commentedWow, 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!
Comment #4
quicksketchAs 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.
Comment #5
13rac1 commentedHmm.. 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.
Comment #6
quicksketchNow we're talking! Those sound like killer configuration options.
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.
Comment #7
quicksketchOkay, 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.
Comment #8
quicksketchComment #9
13rac1 commentedThat 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.
Comment #10
quicksketchOh hmm. It should. At least it works for me in Firefox/Safari. What browser are you using?
Comment #11
13rac1 commentedOdd... I checked again. Now it isn't doing it. I am using FireFox 3.0.6. Well, never mind then.
Comment #12
quicksketchAwesome. :)
Comment #13
13rac1 commented