When used with ImageField and ImageCache, images may be inserted into text areas with a specific ImageCache preset.

Link to original image must be inserted too! (maybe with an optional checkbox)

Now I using much the same module Easy Image Insert, but it has abandoned. You may write a ussue there or/and contact the author..

Comments

quicksketch’s picture

Ah, thanks for the tip about Easy Image Insert. I searched high and low for an existing solution to this problem but I couldn't find one. Looks like it's limited to just tinyMCE support at this point, so it looks like FileField Insert has already surpassed its feature-set (other than not having a D5 version).

As for the request, I'd prefer to NOT add that feature in interest of keeping interfaces simple. If you'd like to unconditionally add a link to the file, I'd suggest editing the filefield-insert-image.tpl.php file.

Gyt’s picture

Interface keep being simple! If I insert the original image, I don't need any links. But if I insert any ImageCache preset, link to the original image inserted too. It's simple, userfriendly and don't need interfaces at all!

(filefield-insert-image.tpl.php file)
* Available variables:
* - field: The CCK field array. -

May I use it for link to the original image? And how?

quicksketch’s picture

Just check if the URL contains "imagecache", and if so, then make it a link.

<?php if (strstr($url, 'imagecache')): ?>
<a href="<?php $url ?>">
<?php endif; ?>
<?php if ($field['widget']['module'] == 'imagefield'): // Use the ALT and Title fields if available. ?>
  <img src="<?php print $url ?>" alt="<?php print $alt ?>" title="<?php print $title ?>" width="<?php print $width ?>" height="<?php print $height ?>" />
<?php else: // For FileField, use the description for both fields. ?>
  <img src="<?php print $url ?>" alt="<?php print $description ?>" title="<?php print $description ?>" width="<?php print $width ?>" height="<?php print $height ?>" />
<?php endif; ?>
<?php if (strstr($url, 'imagecache')): ?>
</a>
<?php endif; ?>
Gyt’s picture

$url isn't the path to the uploaded file - it's a path to imagecache preset, but I need the URL to original uploaded image.
(sorry for my poor english)

quicksketch’s picture

Ah, hmm. Right there's no original image URL available at that point. Currently you'd have to do a preg_replace() to get the URL without the imagecache part of the URL.

thomasmeadows’s picture

I agree with gyt. I personally would not have a use for this module unless it links back to the original image... This could be a very nice implementation for lightbox on my sites. I personally don't know if I have the necessary skills to write this back into the module though.

end user’s picture

I'd have to chime in and say this would be a great feature to be able to insert an imagecache image with a link to the full sized one. Would reduce the amount of space for content and bandwidth consumption.

duozersk’s picture

Doesn't linking to the original image get automatically supported if the Image Resize Filter (also by Nate) is installed? Probably not with using the predefined ImageCache presets, but at least for the "original" size + resizing it via WYSIWYG means should work... not?

pip8786’s picture

This would indeed be a great feature, and I think you may find a duplicate here: http://drupal.org/node/479310

quicksketch’s picture

Status: Active » Closed (duplicate)