How to pass argument %nid to views ?

I use this code:

function magic_tabs_tom_callback($active = 0) {
$view_con = views_get_view('nodecomments_con');

  $tabs[] = array(
    'title' => t('Con '),
'content' => $view_con->execute_display('default', '3'),
  );

Comments

tommytom’s picture

any ideas ?

yhager’s picture

Status: Active » Closed (fixed)
tommytom’s picture

hmmm

yhager’s picture

Status: Closed (fixed) » Active

I'm sorry, I probably misunderstood the question. Is this a views issue? How is it related to magic tabs? Please add more details on your case, so I will be able to assist better, or refer you to the right documentation.

tommytom’s picture

I tried with this code, but it doesn't work. I get this error msg: Fatal error: Cannot use object of type stdClass as array in mysite\sites\all\modules\views\includes\view.inc on line 444


function magic_tabs_tom_callback($active = 0) {
$view_con = views_get_view('nodecomments_con');

 $node = menu_get_object('node');

  $tabs[] = array(
    'title' => t('Con '),
'content' => $view_con->execute_display('default', $node),
  );
tommytom’s picture

I didn't know that the arguments have to be in an array.

'content' => $view_con->execute_display('default', array($node)),

now it works

tommytom’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.