Posted By

level09 on 04/18/09


Tagged

output drupal views custom


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

level09
ReeceMarsland


Custom Views Output


 / Published in: PHP
 

  1. <?php
  2.  
  3. $view = views_get_view('reviews_front');
  4. $view->render();
  5. $images = array();
  6. $teasers = array()
  7. foreach ($view->result as $result) {
  8.  
  9. $node = node_load($result->nid);
  10. $images[] = $node->field_image[0]['view'];
  11. $teasers[] = node_teaser($node->body);
  12.  
  13. }
  14. echo '<div>';
  15. foreach ($images as $img) {
  16. echo $img;
  17. }
  18. echo '</div>';
  19. //same way for teasers ...
  20.  
  21. ?>

Report this snippet  

You need to login to post a comment.