When using the Image Thumbnail field in Views with the 'Output this field as a link' option enabled and a custom link path set, the outputted thumbnail gets wrapped in two link tags. The outer one being the link you specified in Views and the inner link being the default link to the node. This effectively voids the link we were trying to use.

We were able to theme override this by removing line 96
$link_url = isset($options['link_url']) ? $options['link_url'] : 'node/'. $node->nid;

...and then replacing the statement on line 124 (inside of the else clause) with

  if($link_url){
    $output = l($image, $link_url, array('html'=> TRUE));
  }
  else {
    $output = $image;
  }

Comments

jonskulski’s picture

The result of using 'Output this field as a link' as it is, is a double wrapped link

<a href="node/231">
  <a href="views-url-link">$image</a>
</a>
thill_’s picture

I am going to subscribe and +1 this issue, I need to link the thumbnail to something other than the node itself, I can't do this without some views theming which shouldn't be required in this case.