For the Image module, is it possible to remove the direct link to node in galleries?

Only local images are allowed.
http://img14.imageshack.us/img14/9122/1237681691329.png

I'm using Lightbox2 module so I don't want people to go to the nodes.

Thanks.

Comments

coreyp_1’s picture

In your theme, you can override theme_image_gallery_img(). You can use the current version as a guide. The function is found in image/contrib/image_gallery/image_gallery.module.

-Corey

valel46’s picture

Hi Corey,

Thanks a lot for the information.

I opened the image_gallery.module file with WordPad, but I don't which line(s) to edit/remove, sorry my php knowledge is really limited. :/

If you can show me which line(s) to edit/remove, it would be great, all I want is to remove the hyperlink, the name/title can stay.

Thanks again.

coreyp_1’s picture

A couple of things.

First of all, it is bad practice to directly edit a file, whether it is core or contrib, when it can be modified other ways.

In your case, you can add a function to your template.php file (found in your theme's directory) that will replace the output generated by default. The general steps are this:

  1. Copy the theme_image_gallery_img() function into the template.php file of your theme, but rename the function to yourthemename_image_gallery_img().
  2. Make the necessary changes. Specifically, you are looking for this line:
      $content .= '<h3>'. l($image->title, 'node/'. $image->nid) .'</h3>';
    

    And you should replace it with this:

      $content .= '<h3>'. $image->title .'</h3>';
    
  3. Flush your site's cache, and everything should work.

Hope that helps.

-Corey

thollback’s picture

Corey - that was exactly what I was looking for - thanks for your help!

Todd Hollback

valel46’s picture

Corey,

Thanks a lot, really appreciated.

valel46’s picture

Anyone else can help please?

Thanks.

jacker’s picture

Go to admin/build/views/edit/image_gallery , click on Fields/Name and remove "Link this field to its node".