0

I've got a View showing some images. I want to include a link to the image which automatically downloads the file. I'm using the DownloadFile module which makes sure the browser actually downloads the image instead of just displaying it.

I've added the Image field that I want displayed in my View, and I'm checking the Output this field as a link but I don't see any field where I can control the link text. I see title, rel, etc., but I want the actual link text to simply say "Download".

i.e.:

<a href='...'>Download</a>

How can I control the link text of the link being rendered by Views?

1 Answer 1

5

While editing your view, open the field you want to modify. In your case it would be your Image field that current output's <a href='...'>Download</a>

Scroll to 'Rewrite Results' and check the box next to 'Rewrite the output of this field.'

Enter the text that you would like to display instead of 'Download.'

I believe if you use the Tokens module, you will have several variables accessible to you as well. See "Replacement Patterns" in the same menu to see what is available.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.