Node Type in Views Template I made a custom template for my view to print fields into a custom html syntax.  The problem  I have is that in the view I am calling all content types.  Now, in my template file I want to display certain information depending on what content type the content is coming from.

For instance, I want something like this:

If (node-&gt;type['animals']{
    print 'this is the animal node';
}
else{
    print 'this is not the animal node';
}


My fields inside the view are printed as follows, but this works:

&lt;?php print $fields['title']-&gt;content; ?&gt;


The only problem I am having is calling the node type.

I tried adding content type to my views in drupal, then tried it that way:

&lt;?php if ($fields['type']-&gt;content = 'animals'){} ?&gt;


but the view looks through the document and see that there is a content type with that name, and prints the data anyway.
I believe you are using the wrong template in order to access the relevant information. As your comment states your view template is for the entire View, and as you say it looks through the entire document and will always find the content type if any content of that type is present.

Since you are trying to affect a single field, you should look at other template suggestions for fields only in order to process the fields individually instead of trying to do it at the whole View stage.