Would it be possible to add support for Lightbox or any variant? A full list of options: http://www.mindreamz.net/50.html

Comments

sun’s picture

Status: Active » Closed (won't fix)

Possible, yes. But definitely not soon, since Image Assist's JavaScript needs a complete overhaul first. I'd mark this postponed normally, but given the current size of the issue queue and the limited scope of this issue, I'm marking this won't fix.

Carlos Miranda Levy’s picture

Status: Closed (won't fix) » Active

It's pretty simple to adjust code to allow this to happen.

Right now you have the following options for including a link with the rendered image: 'none' => t('Not a link'), 'node' => t('Link to image page'), 'popup' => t('Open in popup window'), 'url' => t('Go to URL').

Just add the option for: 'imagelink' => t('Link to image') and the corresponding code to link the image directly without any custom js popup.

Lightbox2 - http://drupal.org/project/lightbox2 - will take it from there.

All that needs to be done in Lightbox2 is to add "image" to the custom class images listing in the settings screen and you are all set. Lightbox2 will open the link in its own nice Lightbox pop up.

Instructions for Code changes follow:

Change (line 780 of img_assist.module 6.x-2.0-alpha4) at function img_assist_properties_form($form_state, $node, $update):

      '#options' => array('none' => t('Not a link'), 'node' => t('Link to image page'), 'popup' => t('Open in popup window'), 'url' => t('Go to URL')),

into

      '#options' => array('none' => t('Not a link'), 'node' => t('Link to image page'), 'popup' => t('Open in popup window'), 'url' => t('Go to URL'), 'imagelink' => t('Link to image')),


And Add (at line 1508 of img_assist.module 6.x-2.0-alpha4) to function theme_img_assist_inline($node, $size, $attributes):

  elseif ($link == 'imagelink') {
    $popup_url  = file_create_url($node->images[variable_get('img_assist_popup_label', IMAGE_ORIGINAL)]);
    $output .= l($img_tag, $url, array('html' => TRUE));
  }

between

  elseif ($link == 'url') {
    $output .= l($img_tag, $url, array('html' => TRUE));
  }

and

  else {
    $output .= $img_tag;
  }


Change (line 186 of img_assist.admin.inc 6.x-2.0-alpha4) at function img_assist_admin_settings()

    '#options' => array('none' => t('Not a link'), 'node' => t('Link to image page'), 'popup' => t('Open in popup window'), 'url' => t('Go to URL')),

into

    '#options' => array('none' => t('Not a link'), 'node' => t('Link to image page'), 'popup' => t('Open in popup window'), 'url' => t('Go to URL'), 'imagelink' => t('Link to image')),

Right now I have tested it and have it working by choosing the Custom URL option, but for regular users it's a drag to figure out the actual url of the original image. Take a look at the pic in the middle of the article here http://www.socinfo.com/linux-on-windows-and-mac (the one at the beginning and the ones at the end are cck imagefields, so ignore them).

sun’s picture

Status: Active » Closed (won't fix)

This will be resolved via upcoming Wysiwyg integration.

jarizaro’s picture

Solution in #22 works ok, except , there is a little error in this...

And Add (at line 1508 of img_assist.module 6.x-2.0-alpha4) to function theme_img_assist_inline($node, $size, $attributes): ....

The correct code to insert is:

elseif ($link == 'imagelink') {
    $popup_url  = file_create_url($node->images[variable_get('img_assist_popup_label', IMAGE_ORIGINAL)]);
    $output .= l($img_tag, $popup_url, array('html' => TRUE));
  }

Note the output line, i changed url variable name to popup_url. If not, this doesn't work.

With this change, for me, this solution is working ok.