Hi,

I have tried this example,

$tabs['first'] = array(
  'title' => t('One'),
  'type' => 'view',
  'vid' => 'my_view_id',
  'display' => 'my_display',
  'args' => 'my_arguments',
);
$tabs['second'] = array(
  'title' => t('Two'),
  'type' => 'block',
  'bid' => 'my_block_id',
  'hide_title' => TRUE,
);
$tabs['third'] = array(
  'title' => t('Three'),
  'type' => 'node',
  'nid' => 'my_node_id',
  'teaser' => TRUE,
  'hide_title' => TRUE,
);
$tabs['fourth'] = array(
  'title' => t('Four'),
  'type' => 'freetext',
  'text' => 'Hello World',
);

$quicktabs['qtid'] = 'any-unique-id';
$quicktabs['tabs'] = $tabs;
$quicktabs['style'] = 'Excel';
$quicktabs['ajax'] = false;
print theme('quicktabs', $quicktabs);

It working fine when I set ajax to false, but its not working when I set to true. All the tabs return nothing even for free text type.

And in another example, I created 2 views and created a quick tabs block consist of them (using the QT admin page),

view 1 created as block) Takes in a default argument of "node id from url" (Blocks can't take in arg directly..)
view 2 created as page) Takes in a default argument of php code by returning a value

I inserted the tab using example,

$qtid = 42; // write here your quicktabs id.
$quicktabs = quicktabs_load($qtid);
print theme('quicktabs', $quicktabs);

The results shows up correctly filtered by the arguments when setting the QT block to non-ajax but again shows nothing on both tabs if set to ajax. Its seems the arguments are not pass through in ajax mode...?

CommentFileSizeAuthor
#3 screen shot1.jpg101.1 KBS.Siva

Comments

pasqualle’s picture

freetext type can't work in ajax mode, because the quicktabs can't store the long string from the 'text' field (which would be required to load it dynamically). Maybe I should load the freetext type tab normally as non-ajax..

if you create a view using this format (the type must be view!)

$tabs['first'] = array(
  'title' => t('One'),
  'type' => 'view',
  'vid' => 'my_view_id',
  'display' => 'my_display',
  'args' => 'my_arguments',
);

then it should work same as any tab created through the QT admin form. Did you checked that the view tabpage is working in ajax mode (it takes the arguments) if you create it through the admin interface?
The argument handling is the same for non-ajax and ajax views, the only problem could be that it does not renders because it is in ajax mode.
see this issue: #345525: problems with ajax views inside ajax quicktabs (pagination)

I quickly rechecked this. I changed my non-ajax QT created through php code which uses views with arguments, I changed it to ajax mode and it still works..

pasqualle’s picture

Status: Active » Closed (fixed)

The issue is without response and this should not be a problem in the latest release. Closing..

Feel free to reopen the issue if the problem still exists.

S.Siva’s picture

Status: Closed (fixed) » Active
StatusFileSize
new101.1 KB

Hi Pasqualle,

i have a problem with this issue. So i reopned it. I tried to render a block with quictab.

$tabs['second'] = array(
'title' => t('Resources'),
'type' => 'block',
'bid' => 'similargroups_delta_0',
);

i added this code, for og similar groups block which comes from similargroups module, since it dosen't have any view we are using the block to

display it. For time being i have set ajax =false; is there any possibility to fix it.

i have attached the screen shot for this. i have used this in group homepage. any idea's are suggestion welcomed.

pasqualle’s picture

no, the similargroups block will not work in ajax mode, because of this code

function similargroups_block($op='list', $delta=0) {
 ...
  if (arg(0) == 'node' && is_numeric(arg(1))) {

that condition is false in ajax mode, as the ajax view is displayed on the views/ajax path..

katbailey’s picture

Status: Active » Closed (works as designed)