1

I have a content-type "gallery " which is composed of:

  • Field Image
  • Field Link (which is an EXTERNAL link like www.google.com or http://exemple.org)

so i've created a view with the link field hidden(the widget of the link field is: "Title, as Link (default)") and the image field

how should I rewrite the output of the image field to put the external link into the image?

i've tried with this: <a href="[view_node]">[field_image_1]</a> but this is not working

1
  • 1
    If someone is stucked with the same problem: Follow the answer of Gladiator and the widget of the link must be "URL, plain text" otherwise it will not work. Thanks again to Gladiator
    – LuciferSam
    Commented Oct 25, 2013 at 13:15

1 Answer 1

4

Method : 1

  1. Place the link above the image field in the views.
  2. Exclude it from display
  3. Now rewrite the results of the image
  4. a href="[field_link]" image field
  5. This will create the link to the image, so when clicking it will lead the page.

Method :2

  1. Place the link above the image field in the views.
  2. Exclude it from display
  3. Select "output this field as link"
  4. Click the replacement pattern here, and use the link in the text field
  5. This will create the link to the image, so when clicking it will lead the page.
2
  • 1
    I am unable to use proper a tag here, but you use them properly in views.
    – Gladiator
    Commented Oct 25, 2013 at 12:58
  • nice hint!!!!!!
    – Bala
    Commented Oct 25, 2013 at 16:03

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.