I have a content type with 2 primary fields: Image and Link. Image specifies an image to display and Link specifcies a custom URL path. I'd like to setup a views slideshow of this content type where the image is displayed with the link being the Link field. I only see two options in Views: link to image or link to content. I want to link to a custom url as specified inthe Link field. Can this be done? Is there perhaps a module that exists or could be written to perform this task? Thanks!


VM’s picture

did you add the link field to the view?
if so you should be able to rewrite the output of the field you want linked and use the link field token for the link field you added to your content type

mastermindg’s picture

Perfect! I just learned something new :) I setup the link and the alt text as well. Thanks for the help!

## Note: The above code is fictitious. Any resemblance to real or actual working code is purely coincidental.

donok’s picture

Just a note here -- I was able to simply add a link to an image by

1) enabling "ALT" field in the image
2) added the URL of the page I want each image to go to in the ALT field
3) Using Rewrite Results > Output this field as a link and put in the Replacement Pattern for the ALT field [field_image_for_lightbox-alt]

Guit4eva’s picture

Finally! A simple solution! Thank you!! :D

jaesperanza’s picture

ALT field works but shouldn't rewriting output to [views_slideshow_url_link] work as well? Weird, but somehow mine didn't. Using the ALT field (inputting the URL in this field) though as a workaround fixes the issue.