add a url link to an image in a view

in a customer list view that's built from a customter content type with the following fields:

field_logo

field_webaddress

field_streetaddress

field_city

field_country

field_coordinates


I was able to make the Field:Content: Website open a new window using this Rewrite Results code: <a href="[field_webaddress-value]" target= "_blank">[field_webaddress-value]</a>

I was able to make the Field: Content:Map Coordinates open a new window using this Rewrite Results code:<a href="[field_coordinates-value]" target= "_blank"> Click here for map</a>

Now I want to attach a url(field_webaddress) to the logo (field_logo)using the Rewrite Results code.

Shouldn't this code work?
<a href="[field_webaddress-value]" target= "_blank">[field_logo]</a>

kzumwalt's picture

I got it figured out with the help of a friend.
You have to have the website address field above the logo field so I had to add a second website address field so it would be before the logo field, make it hidden, then add [field_webaddress_1] to the "Output this field as a link section"

I was trying to do both at once by adding <a href="[field_webaddress]" target= "_blank">[field_logo]</a> to the "Output this field as a link section" instead of "Rewrite the output of this field"
and I didn't have the Content: Website above the logo field I was attempting to attach it to, which is little known requirement.

Ryan G's picture

Thanks so much for posting this, I'm a newb and this helped tremendously.

Kirk's picture

yeah, that one was pretty tricky, I kept telling the guy that helped me: "It shouldn't be this difficult!"
Glad it helped you!

Mike's picture

Hi,

I tried to do that as you said, but this is not working for me.

I get output like: title of the web address "> image_field and that would be all :/

any ideas?

Add new comment