Error when printing URI in drupal Views I tried to print the Image field URI and the image field in the views-field.tpl and i got this error. 
Notice: Undefined index: field_photo in include() (line 6 of timeline.tpl.php).
Notice: Trying to get property of non-object in include() (line 6 of timeline.tpl.php).

Here is my code

&lt;li class="row no-margin"&gt;
    &lt;div class="timeline-badge &lt;?php print $fields['field_event']-&gt;content ?&gt;" data-toggle="tooltip" data-placement="top" title="&lt;?php print $fields['field_event']-&gt;content ?&gt;"&gt;&lt;?php print $fields['field_icon']-&gt;content ?&gt;&lt;/div&gt;
    &lt;div class="timeline-panel"&gt;
        &lt;div class="timeline-mins"&gt;&lt;?php print $fields['field_minute']-&gt;content ?&gt;&lt;/div&gt;    
        &lt;div class="timeline-comment"&gt;&lt;?php print $fields['field_comment']-&gt;content ?&gt;&lt;/div&gt;
        &lt;?php if($fields['field_photo']-&gt;content){  ?&gt;
        &lt;div class="timeline-photo"&gt;
        &lt;a id="tml-photo" href="&lt;?php  print $fields['uri']-&gt;content; ?&gt;" title="&lt;?php print $fields['field_comment']-&gt;content ?&gt;"&gt;
        &lt;?php print $fields['field_photo']-&gt;content ?&gt;
        &lt;/a&gt;    &lt;/div&gt;
        &lt;?php } ?&gt;
    &lt;/div&gt;
&lt;/li&gt;
If you just want to check if it has a value, you can add a check if it exists, so on row 6:

&lt;?php if (isset($fields['fields_photo']-&gt;content) &amp;&amp; $fields['fields_photo']-&gt;content) { ?&gt;


Otherwise do a &lt;?php dpm($fields); ?&gt; to see what is actually available to use for your theme.

It couldn't be that you have set it to "Exclude from display"?