I built an image gallery using CCK + Imagecache + Imagefield + Views.

The View shows only two fields:

  • the thumbnail image (as link to node)
  • The node title

What I need to do is that this link to node also opens a new pop-up window, with the full node. Just like it happens in Getty Images, for exemple.

I know that for this, I have to put a little javascript in it.
Just like:

<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

And put a "onclick" within the link:
<a href="#" onclick="MM_openBrWindow('teste.html','Nome da Janela','scrollbars=yes,width=800,height=600')">Link</a>

But how can I put this "onclick" in the link???

I've tried using the Active Template module, which allows to edit the node, teaser and the fields of the Views. But I couldn't find the right arrays there.

I don't mind if there's a 'hacky' solution within the views module. But I'd rather do it a much cleaner way!!

Any tips are welcome!!
thx

Comments

haraldessert’s picture

By the way...

This is my site I'm trying to change:
http://www.kphotos.com.br/photo/

And this is an example of what I want to happen when I click on a thumbnail in my site:
http://www.gettyimages.com/Search/Search.aspx?EventId=82711571

karens’s picture

Project: Views (for Drupal 7) » ImageField
Version: 5.x-1.5 » 5.x-2.1
Assigned: haraldessert » Unassigned

This is obviously an Imagefield issue, don't report questions about other modules on the Views issue queue, report them in the logical place, the module you are asking about.

And you're not assigned to fix this unless you plan to answer you own question :)

haraldessert’s picture

Assigned: Unassigned » haraldessert

Sorry, Karen!!
I really thought the link was generated by Views, not by Imagefield. But also thanks: this is a good start!! I'll seek in the Imagefield module to find where the link is built.

Anyways... I'm still ost here. If someone could tell me an easy and 'cleaner' way to do this without hacking the module, it'd help me a lot.
Maybe someone else also needs a support about this.

Thx.

haraldessert’s picture

Status: Active » Fixed

This is not actually fixed, since I just found another way to do this.
A friend recommended me the Lightbox module, which I didn't know also provides a whole page view. I thought it was just about images and galleries. So it did fine!

But sincerely I think modules like Imagefield, that provide fields and links also within other modules, should allow the possibility of adding arguments in the link.

haraldessert’s picture

Title: How to change link characteristics of a image_field showed as link to node? » How to open a page in a pop-up window through a link within a View?

I'm changing the title of this support request, because I think this title isn't self-explaining enough so that another person could find it easily in case of the same or a similar doupt.

idflorin’s picture

So ... I want to open the link to original image with target="_blank" , where do I have to edit the module to add the target="_blank" ?
I tried several places without no effect.

Thanks

---------------------
Chic

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.