How to get an image url given term_image_tid using the customfield-PHP views module I have created a view of type Term that lists all the taxonomy terms plus each term's image. This works. But now I want to wrap the images in a link that links to another view. I am trying to use the customfield: PHP Code field to build up an html string containing the image and the link. The only bit that I cant figure out is how to get the url of the image.

If i do print_r( $data); I get...

stdClass Object ( [tid] =&gt; 7 
[term_data_name] =&gt; Old Edinburgh 
[term_data_vid] =&gt; 2 
[term_image_tid] =&gt; 7 ) 


And the sql query is...

SELECT DISTINCT(term_data.tid) AS tid,
   term_data.name AS term_data_name,
   term_data.vid AS term_data_vid,
   term_image.tid AS term_image_tid
 FROM term_data term_data 
 LEFT JOIN term_node term_node ON term_data.tid = term_node.tid
 INNER JOIN node node_term_node ON term_node.vid = node_term_node.vid
 LEFT JOIN term_image term_image ON term_data.tid = term_image.tid
  GROUP BY tid
You shouldn't use a PHP code field, rather you can use the Image URL formatter module to create a image URL field, exclude it from display, &amp; then use that image URL field to feed into a Global: Custom text field with your own custom img &amp; a markup.