I am using Drupal 7 & quicktab . I am trying to create quicktabs from codes. Suppose i created the a test url in using hook menu.
$items['MyModule/test'] = array(
'title' => 'Test Tabs',
'type' => MENU_CALLBACK,
'page callback' => 'test',
'page arguments' => array(2),
'access arguments' => array('access content')
);
In test function ,
function test(){
$name = "Test tabs";
$settings = array(
'ajax' => 0 ,
'hide_if_empty' => 1,
'default_tab' => 0,
'title' => 'Test quicktabs',
'rendered' => 'quicktabs',
'style' => 'Basic',
);
$custom_tabs = array(
array(
'title' => 'Test tab1',
'path' => 'test-tab1',
'contents' => "Test tab1",
'weight' => 0
),
array(
'title' => 'Test tab2',
'path' => 'test-tab2',
'contents' => "Test tab2",
'weight' => 0
));
return drupal_render(quicktabs_build_quicktabs($name, $settings, $custom_tabs));
}
By using above code , i am successfully able to create quicktabs, But It is showing same (Test tab 1) content on both tabs. Content is not changing. I cleared the cache also.
Also, How to edit the path of tabs?? Above path is not working . It is showing ugly path like this (http:[baseUrl]/test?qt-my_custom_quicktab=3&qt-Test%20tabs=0#qt-Test%20tabs)
Is there any better way to implement quicktabs.May be with hooks but documentation is insufficient. If anyone knows better implementation guide me . My tabs will be dynamic.