Making an Image Clickable in a Drupal View

Authored on
Sat, 12/02/2023 - 13:37
Tags
Body

Here is the simplest way I know of to make something, like an image, a link to content in a Drupal view. It's useful for making things like a grid of images that need to link to content.

1. Add a Content: ID field and exclude it from display. Make sure it is on top of the list of fields.
2. Add a Content: Image field.
3. Click on the Content: Image field to edit it.
4. Click Rewrite results and select "Output this field as a custom link”.
5. Set the path to /node/{{ nid }}.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <blockquote cite> <br> <cite> <code> <dd> <dl> <dt> <em> <h2> <h3> <h4> <h5> <h6> <li> <ol start type> <p> <strong> <ul type>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.