Is there any way to have images inserted with IMCE popup in the lightbox?
As far as I know, IMCE does not insert the a tag. I could go around it by modifying the IMCE code, but what to insert into the a tag to trigger the lightbox?

Comments

stella’s picture

Do you have a site setup which contains images uploaded by IMCE which I could take a look at?

When uploading images via IMCE, is it possible to (a) give the image a class name or (b) give the surrounding anchor a "rel" attribute (assuming not)? Or does IMCE assign a class name to the uploaded image when you view it?

Cheers,
Stella

softtouch’s picture

After checking what imce creates, it does simply insert the img tag, nothing else:

<img src="/files/u1/100_4373_0.jpg" width="120" height="90" alt="100_4373_0.jpg" />

Which would mean, I would have to modify the module itself to let it add the a tag with rel="lightbox" etc.

If thumbnail is enabled in imce, it create 2 files:
100_4373_0.jpg - The thumbnail
100_4373.jpg - The full size image

I believe, it was a stupid idea to use IMCE and I better switch back to image_assist, even it is annoying that it add the image to the gallery...

stella’s picture

Project: Lightbox2 » IMCE
Version: 5.x-2.x-dev » 5.x-1.x-dev
Component: Miscellaneous » User interface
Category: feature » support

The rel="lightbox" does not need to be added to the img but rather to the surrounding anchor a tag, if one exists. The anchor tag is vital for lightbox to work.

Re-assigning this issue to the IMCE list so they can tell you how to add either (a) rel="lightbox" to the anchor tag, or (b) how to assign a class name to the image tag.

Cheers,
Stella

ass45sin’s picture

On the example below I have lefty set as an image trigger class on Lightbox2 5.x-2.5, but for some reason even after giving a special class to the image tag lightbox only shows the image of the img tag instead of displaying the image on the anchor tag. The class was given by IMCE version 5.x-1.2 which is set to use CSS classes from the theme.

<a href="/durpfile/u1/great_whiteshark_0.jpg"><img src="/durpfile/u1/great_whiteshark_1.jpg" class="lefty" alt="A great white shark swimming" title="White Shark" align="left" height="142" width="200" /></a>

On the other hand giving rel=lightbox on the surrounding anchor text works.

Have I missed something here? Or is this a lightbox issue.

merilainen’s picture

So is there anyway to assign rel="lightbox" to picture links with IMCE? Or classify images automatically to use lightbox?

ufku’s picture

it depends on the interface adding the image link. tinymce? fckeditor? bueditor? imce inline?
IMCE does not interfere with the code added. It just sends the file path to editors.

merilainen’s picture

I'm using FCKeditor at the moment. It is a possible to add class="lightbox" to img manually, but it would be nice to have it inserted automatically.

superflyman’s picture

Version: 5.x-1.x-dev » 6.x-1.0

I am trying to get Lightbox2 to work using TinyMCE and IMCE. Lightbox works when images are inserted with the image upload function in a story. However, when I add inline images using IMCE (insert main image and secondarily create link to url) the picture opens in a separate node. I have configured the lightbox automatic handler for inline images but no lightbox launches. Any thoughts? Should i be doing something different with IMCE when creating inline images?

stella’s picture

"inline" images refer to ones created with the Inline module. For TinyMCE integration, see http://drupal.org/node/252153

superflyman’s picture

Stella, thanks soo much! Solved the problem...

stella’s picture

superflyman: that's unrelated to the lightbox2 question raised here, please open a separate issue. Thanks.

sicarius-1’s picture

You can take a look at this http://drupal.org/node/314566

This is how I got IMCE + FCKEditor + Lightbox all to work together nicely, and there's a section there on how to make images added with FCKEditor to be associated with lightbox automatically.

Be aware that you need to make modification to the code to make it work, but it's relatively simple change.

encho’s picture

Nice. Anyone has TinyMCE solution?

eagereyes’s picture

I just did this with the TinyTinyMCE module: on its admin page, find "TinyMCE init script for advanced mode," and under "extended_valid_elements" at the very end, add "rel" to the list under the a tag (it's the first element listed). Then edit a posting, and in a link to the image you want to see in Lightbox, click on the advanced tab in the link popup and select "Lightbox" from the "Relationship" drop-down box. This needs to be done in advanced mode, I don't think you can do it in simple mode.

Cohassetsteve’s picture

A big thanks for #14 from a relative Drupal newbie. It worked like a champ. It now preserves the rel="lightframe" tag as well - now to be able to add lightframe from the advanced tab...

rajmataj’s picture

Issue tags: +imce, +wysiwyg, +lightbox, +ckeditor

Lightbox, CKEditor, WYSIWYG and IMCE living together:

http://drupal.org/node/1002110#comment-4112474

ufku’s picture

Status: Active » Closed (fixed)
Issue tags: -imce, -wysiwyg, -lightbox, -ckeditor

Closing 6.x-1.x issues as this branch is no more supported.