I'm trying to make the download link in Lightbox2 available. I'm using Lightbox2 6.x 1.9, which has an option in the Layout settings that's called "Text for original image link". This is the text that will appear as the link to the original file underneath the image in the lightbox.

I want to enable this text so users can download the images displayed in Fastgallery by clicking the download link in Lightbox. Therefore I typed "Download file" in the option in lightbox, without any result. The link is not shown. I read all the documentation from bot Fastgallery and Lightbox but I can't find an answer. Can you help me to find a way to make downloads possible from the lightbox window?

Thanks!

Comments

shiraz dindar’s picture

subscribing. looking for the same.

serkan.arikusu’s picture

Status: Active » Closed (works as designed)

Hi,
This is from the release notes:

New 'download' link feature for imagefields and image.module images. This also means the addition of a new 'download original image' permission.

If you are not uploading your files by these modules, there is no chance for this in this version. Hope that it will be available in the future.

simonlau_01’s picture

Hmm... For admin can download. Anonymous and authenticated user can't download although I had set the permission too.

catellani.m’s picture

I've the same problem:
- lightbox installed;
- permission to download original image enabled for all roles;
- as admin I can download the image, but no one else can do.

Any help will be appreciated!

jkusachi’s picture

Hey guys,

looking at the module code, I was able to come up with the solution.

If you notice in lightbox.module, in line 708, you'll see this:

  if (user_access('download original image') && user_access('view original images')) {
    $js_settings['download_link_text'] = check_plain(variable_get('lightbox2_download_link_text', 'Download Original'));
  }

so basically the download link text will show if you have the 2 permissions, "download original image" as well as "view original images"

However, if you take a look at lightbox2.formatter.inc, line 186, you will see this:

    if (!empty($download_link_text) && user_access('download original image') && user_access('view imagefield uploads')) {
      $node_links[] = l($download_link_text, $item['filepath'], array('attributes' => array('target' => '_blank', 'id' => 'download_link_text')));
    }

Notice how the 2nd condition is if the user has the permission "view imagefield uploads", NOT "view original images".

So, I edited line 186 of lightbox2.formatter.inc from "view imagefield uploads" to "view imagefield uploads" and got it to work fine and dandy.

I think this should be addressed?

Let me know if you have any questions.

vako’s picture

Is this issue resolved? I have the same request and can't find the download option for the slideshow, even though the permission is set.
Also would like to know if Print option is possible with Lightbox 2