How can I print out individual fields from my view in views-view-unformatted.tpl.php? There's only the print $row; but this prints out all fields defined in the view, I want to print out each field individually. Tx for giving me a little bit of code.

Comments

dnewkerk’s picture

I wrote a tip a while back about this, see http://drupal.org/node/368691#comment-1236820
Hope this helps.

widiotter’s picture

I put print $fields['anriss_news']->content; in the template - "anriss_news" is the name of the field I want to print out - it doesn't work :-(

b.c.’s picture

This was driving me nuts for hours... note that the view has to be set to Style: Unformatted and Row style: Fields.

Prancz_Adam’s picture

I have also faced with this problem. I would like to add some cool jquery effects to elements of a views row. I need ad extra divs around some field groups.

I need an output like this from views:


Image field


field 1
field 2
field 3

It is needed to print the $field by one by one from views-view-unformatted--{myview}.tpl.php but I can't access to the fields value and I can't find any help for this.

Sumit Gawde’s picture

I am facing same problem, anyone got solution for this?

Thanks you in advance.

deveshkumar’s picture

<?php foreach ($rows as $id => $row): ?>

<h2><?php print $view->render_field('title',$id);?><h2>

<?php endforeach; ?>