title: Drupal Views: Handle title field links differently depending on content type?
body: <p>I have a view that pulls in the titles from 3 different content types. One of these content types has a title that should link to an external website, the other 2 types have titles that link to nodes within the Drupal site. Is there a way I can set the Title field to handle links differently depending on what content type the title is from?</p>
  
  <p><strong>Answered thanks to Vlad below!! :)</strong></p>
  
  <p>This is the working code we are using in the <code>views-view-fields--news--block.tpl.php</code> template..</p>
  
  <pre><code>&lt;?php if ($fields['type']-&gt;content == 'Event'): ?&gt;
    &lt;a href="&lt;?php print $fields['path']-&gt;content; ?&gt;"&gt;&lt;?php print $fields['title']-&gt;content; ?&gt;&lt;/a&gt;
  &lt;?php endif; ?&gt;
  
  &lt;?php if ($fields['type']-&gt;content == 'PATF News'): ?&gt;
    &lt;a href="&lt;?php print $fields['path']-&gt;content; ?&gt;"&gt;&lt;?php print $fields['title']-&gt;content; ?&gt;&lt;/a&gt;
  &lt;?php endif; ?&gt;
  
  &lt;?php if ($fields['type']-&gt;content == 'News Link'): ?&gt;
  //This link goes to _blank
   &lt;a href="&lt;?php print $fields['field_link']-&gt;content; ?&gt;" target="_blank"&gt;&lt;?php print $fields['title']-&gt;content; ?&gt;&lt;/a&gt;
  &lt;?php endif; ?&gt;
  </code></pre>