Hi All,

I'm new to view theming so would appreciate any help. I'm trying to add a Vote Up/Down widget to each row of a table view and I guess I'm not understanding how the "print $vote_up_down_widget;" code is supposed to work. When I try to add it to my cell['data'] it just gives a value of 1.

Here is my template.php fcn:

function bluemarine_views_view_table_navigationmm($view, $nodes, $type) {

  $header = array();
    foreach ($view->field as $field) {
        $cell['data']=$field['label'];
        //$cell['class']=$field['header'];
		$cell['class']="header";
        $header[] = $cell;
    }
	//add an extra header for the Vote Up/Down column 
	$cell['data']="Vote Up/Down";
        $cell['class']="header";
        $header[] = $cell;
  $fields = _views_get_fields();

 
	foreach ($nodes as $node) {
        $row = array();
		$myfields = $view->field;
		//$link = "test";
	
        foreach ($myfields as $field) {
		
		
            $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            $cell['class']='view-field-'.$field['queryname'];
            $row[] = $cell;
             
        }
		
		//the line below does not work
        $cell['data'] = print $vote_up_down_widget;
            $cell['class']= "vote_widget";
            $row[] = $cell;
		$rows[] = $row;
    }
  
  return theme('table', $header, $rows, array('class' => 'show-table'));
}

Can anyone point me in the right direction here?

Thanks!

Comments

jmunning’s picture

Anyone out there know how to do this?

Thanks.

Anonymous’s picture

a computed php field maybe where you just call the function to display the widget?

marvil07’s picture

Status: Active » Closed (won't fix)

Please take a look to the update on the project page, now 5.x is not-really-maintained.

If you think your question is still applicably to the last recommended version(6.x-2.x) please move the version accordingly and reopen it.