Tabs

Use the following to print stuff in tabs from a node or even a node.tpl.php page.

// call a view to print the address of the current node

$view_address = views_get_view('address_view_reference');
$display_id = 'page_1';
if (!empty($view_address)) {
  $address_output = $view_address->execute_display($display_id, array($node->nid));
}

$form = array();
$form['listtabs'] = array(
'#type' => 'tabset',
);
$form['listtabs']['tab1'] = array(
'#type' => 'tabpage',
'#title' => t('Title 1'),
'#content' => $address_output,
);
$form['listtabs']['tab2'] = array(
'#type' => 'tabpage',
'#title' => t('Title 2'),
'#content' => "content goes here",
);
print tabs_render($form);

Contact Me

Feel free to contact me.

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.