Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The Insert module currently supports inserting an ImageCache preset.
However, it doesn't appear to support inserting, say, a thumbnail-sized image with a link to the original, the way you can in Display Fields for an Imagefield CCK field.
Hopefully that made sense... basically I want the ability to insert a thumbnail (imagecache preset I've set up), but have people be able to click the thumbnail to see the full-size image.
Thanks for considering it... very useful module!
Comment | File | Size | Author |
---|---|---|---|
#11 | feature-preset-with-link-d7.patch | 1.29 KB | jorge.suarez |
#6 | 1163080-feature-preset-with-link.patch | 1.54 KB | jhodgdon |
Comments
Comment #1
jhodgdonAnd by the way, I'm attempting to get my client who wants this to pay for me to develop this feature (shouldn't be too difficult). But it would be for D6 if I do it...
Comment #2
protools CreditAttribution: protools commentedsub for 7 too, all the power of the fields where it has got to. In a teaser you can not control a large or small image, a link to the file, too ... may need to revise the architecture of the module ... Very useful functionality and are often required. good module, but the power of the fields should be preserved
Comment #3
jhodgdonIf you want something different in teaser vs. full page, then you shouldn't be using Insert, IMO. Insert puts an image tag into the page body, so there isn't going to be a way to make it appear different on teaser vs. full page, because it's part of the body's HTML. You need to just use an image field, and not insert it, for that.
Comment #4
protools CreditAttribution: protools commentedyes, i can use IMCE or many other things, but power of the fields take a lot of things like integration with Views, and teaser, and yes we need to insert image into the body - with float, userfriendly and easy way. Insert can be great tool for this, but very little is not enough.
Comment #5
jhodgdonMy client agreed to fund the D6 development of this feature. I'm working on it and will provide a patch shortly.
Comment #6
jhodgdonHere's a patch against the 6.x-1.x branch, which works for me.
Comment #7
ralphb CreditAttribution: ralphb commentedI'd like to see this feature in Drupal 7 as well (see #1391186: Insert as link).
Comment #8
Rameez CreditAttribution: Rameez commentedIn teaser we can handle the display with imagechace , here we should simply create copy of image by resizing it and linking it to original one. Like in wordpress we get thumb sub-directory in every image folder.
Comment #9
quicksketchTake a look at Image Resize Filter.
Comment #10
mattwmc CreditAttribution: mattwmc commentedIs there anyway to modify the patch to change the link to image source file path?
For instance, for enlarging images I uses a php code to open in new template.
All that is required is sticking this before the relative file path:
Example:
Inserted image reads:
Link to "original" would then read:
Possible?
Comment #11
jorge.suarez CreditAttribution: jorge.suarez commentedHere is a patch for D7 version, based on D6 patch provided by jhodgdon. It's working here. Hope it works ok for you as well.
Must apply on modules/insert/includes directory. Sorry for the inconvenience.
Comment #12
jackhutton CreditAttribution: jackhutton commentedThank you for the Insert Module and THANK YOU to jorge.suarez and jhodgdon for the work creating the image caches styles with a link back to the original file option. Super useful .. just saved me alot of time.. Thank you!!
ran the patch in #11 and works great. :)
Comment #13
jackhutton CreditAttribution: jackhutton commentedagain, thanks for this work.
Q: How would I make the embedded URL site agnostic? I moved the site from local up to the webserver and the url for the embedded linked image ( which is so so so great! thx ) has the relative sitepath vs. an explicit sitepath.. ?
Just noticed this as the images don't show in the articles using this linked image style..
Comment #14
quicksketchHi guys, I'm not sure about this patch. It's approach really isn't compatible with the D7 approach to image styles (which now avoids the ridiculous "image cache preset list of DOOM", where every preset has 8 different options (preset, preset with link, preset with lightbox, preset with link to preset b, preset with lightbox to preset b, etc).
In the interim, would an approach that simply provided "original_url" as a variable in imagecache-insert-image.tpl.php work for you guys? Otherwise, I think this should be implemented as a second option in the Insert form, which would now look like this:
Insert: [ preset names dropdown | v ] [x] Link to original
Though things get a little hairy since the Link to original checkbox would only show up certain styles. Obviously it wouldn't make much sense for the Link or Original styles.
Comment #15
cheese_monkey CreditAttribution: cheese_monkey commentedI would be thrilled with more available variables, so "original_url" would be fine from the perspective of a beginning site modder.
I'm trying to handle using Insert with a wiki-like text format that doesn't permit raw HTML, but that does support a markup for images. I think I've figured out how to emit the markup instead of the HTML, but it assumes that the user is always using this specific markup (say, instead of changing to "Full HTML", which is an option for that userbase). If we're meant to fill out the insertion styles algorithmically, then I'd really like to have the "Text format" variable somewhere. It might already be there, I'm still trying to figure how&where to name the code to run. (Where is "imagecache-insert-image.tpl.php"?)
Comment #16
leahmd CreditAttribution: leahmd commented+1 for "an approach that simply provided "original_url" as a variable in image-insert-image.tpl.php" in #14. I could really do with this for an educational site.
Comment #17
jmsosso CreditAttribution: jmsosso commentedI just implement this for Drupal 7 modifying the template
image-insert-image.tpl.php
in this way:I also added more attributes to the
a
tag to use the “prettyPhoto” plugin to show a zoom effect when the image are clicked.Comment #18
Snater CreditAttribution: Snater commentedBrowsing through old tickets while working on the module's D8 version, I am closing this ticket due to its age and since D6 supported has ceased. Referring to #632240: Add option to link image to a image style preset for Drupal 7.