I use the Link Image Field module to achieve this mostly, however for a new site I'm pulling items in from RSS feeds and entering in the URL's manually isn't feasible, and isn't possible using the Feeds mapper.

So. I think I can do the same thing using Views "Output this field as a link" setting, but I don't know what to put there to load the data from my link field. http://drupal.org/project/link

Keep in mind I could just as easily do this using a regular text field, so if you know how to do that, please let me know! :) I can just map the link field twice on my RSS import.

Comments

parasox’s picture

Okay I figured it out. I needed to add the field that I'm keeping my link in to my actual view and exclude it from display, as well as making sure it's listed first in the field order of the view. Then I was able to use the token and it works perfectly.

Another note, I wasn't able to use the Link field, as it's saving special characters like ? and = as % signs, so I went with a standard text field.

ryank76’s picture

This would have driven me mad. Works perfectly.

morleti’s picture

Thank you so much! It is very helpful!

cabplan’s picture

So I am trying to do this same thing in my view, I have slideshow and a link field that I can add a URL to but I am having a hard time wrapping the link around the image. I added both fields (Link and Slider Image) but not sure how to link the slider image to the link. I tried to hard code in the Rewrite Result but not sure how to use the correct drupal code. Please help

payamspot’s picture

I was searching for how to do this (adding URL field of type link to image) in Drupal 7, and I couldn't find it. I found how to do it, so I write it here for people who may search for it in the future:

First add the link field in Views.
Then add the image field in Views and while editing it, go to "Show Rewrite results" and check "Output this field as a link" and add for example "[field_link]" as the "Link path"

Hope it helps :)

makt’s picture

I've successfully linked my images to a URL-- however there are a few images where there is no URL mapped but it is still clickable. It reloads the page that the image is on when clicked.

Does anyone know how to make it not clickable?

Thanks!