Fix for I used hook_views_post_render to change the output of a view, I just want to be sure that i didn't do it wrong

  1. function myview_views_post_render(&$view, &$output, &$cache) {
  2.  //dvm($cache);
  3.  
  4.  if($view->name = 'product_list') {
  5.   dpm($view); //There is a link per image
  6.   $output ='';
  7.   //$cache ='';
  8.   if($view->style_plugin->rendered_fields){
  9.    foreach($view->style_plugin->rendered_fields as $key =>$value){
  10.     $imagepath =$view->style_plugin->rendered_fields[$key]['field_image_cache_fid'];
  11.     $alt= $view->style_plugin->rendered_fields[$key]['field_image_cache_data'];
  12.     $title= $view->style_plugin->rendered_fields[$key]['field_image_cache_data'];
  13.     $attributes = '';
  14.     $path = $view->style_plugin->rendered_fields[$key]['path'];
  15.     if ($key ==0 || $key == 11){$img = theme('imagecache', 'big_pic', $imagepath, $alt, $title,  $attributes);}
  16.     else {$img = theme('imagecache', 'little_pic', $imagepath, $alt, $title,  $attributes);     }
  17.    
  18.      $output .= l($img, $path, array('html' => 'true', 'attributes' => array('class' => 'product-link','alt' => $alt, 'title' => $title, 'html' => 'true')));
  19.      
  20.    }      
  21.   }
  22.   dpm($view); //Instead of the link there is am image, the right size linked to the link
  23.  }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.