Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By widiotter on
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
I wrote a tip a while back
I wrote a tip a while back about this, see http://drupal.org/node/368691#comment-1236820
Hope this helps.
<?php print $fields['anriss_news']->content; ?>
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 :-(This was driving me nuts for
This was driving me nuts for hours... note that the view has to be set to Style: Unformatted and Row style: Fields.
I have also faced with this problem
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.
Prancz Ádám
Könyvelés, adótanácsadás, webdesign
I am facing same problem,
I am facing same problem, anyone got solution for this?
Thanks you in advance.
views unformatted tpl fields print
<?php foreach ($rows as $id => $row): ?>
<h2><?php print $view->render_field('title',$id);?><h2>
<?php endforeach; ?>