So i've scoured through all of drupal to figure out how to use the tabs.module. I've used the code in the readme text document. I've created tabs, and i can't figure out how to add tabs. But i'm pretty much stuck from there, i can't figure out how to load pages to each tab. any type of direction would help. Thanks!

Comments

nedjo’s picture

Title: HELP PLEASE SO STUCK » Help creating tabs

Pls post your draft code.

jazojigga’s picture

 $form = array();

  $form['example1'] = array(
    '#type' => 'tabset',
  );
  $form['example1']['tab1'] = array(
    '#type' => 'tabpage',
    '#title' => t('About Us'),
    '#content' => t('  '),
  );
  $form['example1']['tab2'] = array(
    '#type' => 'tabpage',
    '#title' => t('Events'),
    '#content' => t(' '),
  );
  $form['example1']['tab3'] = array(
    '#type' => 'tabpage',
    '#title' => t('Membership'),
    '#content' => t('  '),
  );
  $form['example1']['tab4'] = array(
    '#type' => 'tabpage',
    '#title' => t('Officers'),
    '#content' => t('  '),
  );
  return tabs_render($form);

That is the code that i have in the body of my front page node, i don't know how to make each tab link to another page node.

nedjo’s picture

You can do what you're trying to do with the panelsblock module. Create a panel, add the nodes to it, and expose it as a block of tabs style. Then display that block in a panel on your home page.

jazojigga’s picture

Hmmm... i think i get what you're saying. I'll try it out. THanks a bunch!!!

brmassa’s picture

Assigned: jazojigga » brmassa

Nedjo,

i tried to do what you proposed, using all these modules. but i found twe problems:

  1. it only shows a single tab (the current column)
  2. despite the JavaScript/AJAX about tabs, the pager on my views will reload the entire page.

So i need:

  1. Show all columns using this panel integration OR make AJAX available on tabs creation. like $form['tab'] = array('#type' => 'tabset', '#attributes' => array('remote' => true));
  2. A way to reload the same tab content. The pager should refresh the internal tab contant but the we all current tabs get disabled.

regards,

massa

brmassa’s picture

Status: Active » Closed (fixed)

no replies