can quick tabs be used for normal pages as well ?

current iam using it like this

quick tab block shows only if page is "book1" and location of quick tab block is set in the center
its the quicktab block which does all the pulling of data from all over the place and displays them within each tab

the actual "book1" node shows up only very little content

so it seems like the quicktab block IS the content for book1

Comments

Pasqualle’s picture

Title: render quicktab programatically » quicktabs inside node
Component: Documentation » Miscellaneous
Category: task » support
Status: Active » Postponed (maintainer needs more info)

if php format is enabled for the node, then you can insert quicktabs like this:

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

you can even create the quicktabs dynamically, for 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', // check comment #14
  '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);

so you don't need to place the quicktabs block to any region.. does it answer your question?
maybe using an insert_quicktabs module (not exists yet) would be easier

EDIT: this example does not work correctly in ajax mode, change the identifier to 'anyuniqueid'. Do not use hyphens in qtid till this issue is not fixed #449628: Programmatically Create Quicktabs $quicktabs['qtid'] cannot contain dashes

dropchew’s picture

Title: tabs for normal pages » quicktabs inside node
Version: 6.x-1.0-beta1 » 6.x-2.x-dev
Category: task » support
Status: Active » Postponed (maintainer needs more info)

Hi,

I have created an issue http://drupal.org/node/345581 regarding arguments in ajax. Thanks

Pasqualle’s picture

Title: quicktabs inside node » render quicktab programatically
Component: Miscellaneous » Documentation
Category: support » task
Status: Postponed (maintainer needs more info) » Active

create a book page about "render quicktab programatically" from these examples

Woggers’s picture

Can you please expand on this? I have created a quicktab programmatically in a module i've written but when executing
$content = theme('quicktabs', $quicktabs) I keep getting a NULL result?

Pasqualle’s picture

I need to know what you have in the $quicktabs variable to be able to help you..

This simple example should always work in a node with PHP input format:

$tabs['0'] = array(
  'title' => t('Hello'),
  'type' => 'freetext',
  'text' => 'Hello World',
);

$quicktabs['qtid'] = 'unique-id';
$quicktabs['tabs'] = $tabs;
$quicktabs['style'] = 'Excel';
$quicktabs['ajax'] = FALSE;
print theme('quicktabs', $quicktabs);
Igbonine’s picture

Does this include drupal 5.x

Pasqualle’s picture

@ezunkwelle: no. This works only with 6.x-2.0 (and above)

bartclarkson’s picture

I found it necessary to start out the code snippets above with $tabs = array(); Without typing the $tabs, I received warnings and breakage.

Pasqualle’s picture

as I know, if you define one element in the array then it is an array, so I don't understand why do you have to specially define it..

aharown07’s picture

Code in #1 works fine for me

Pasqualle’s picture

important note: "freetext" type tab does not work with ajax quicktab, it is not possible.

Pasqualle’s picture

for the original question. other options to display quicktab in one node:
1. if PHP input format is not enabled you can use the Insert Block module
2. create a theme template file page-node-42.tpl.php (or other template file options: http://drupal.org/node/190815), and insert the PHP snippet (#1) into that file (EDIT: this is not wrong, see comment #13)

Pasqualle’s picture

this script mostly does not work inside page.tpl.php and page-*tpl.php templates as quicktabs needs additional js and css files. (this problem is not Quick Tabs specific, same applies for example for Views) Calling drupal_add_css() or drupal_add_js() from page.tpl.php has no effect..

So if you really need to render quicktabs inside page.tpl.php you need to add the required files manually.. As it is hard to list all the required css and js files, the better option would be to make the quicktab rendering inside the preprocess function..
you can do it in theme's template.php file

function MYTHEMENAME_preprocess_page(&$vars) {
  // As quicktabs require additional js and css files, we must construct the quicktab here.
  $quicktabs = quicktabs_load(42);
  $vars['myquicktab'] = theme('quicktabs', $quicktabs);

  // Reconstruct CSS and JS variables.
  $vars['css'] = drupal_add_css();
  $vars['styles'] = drupal_get_css();
  $vars['scripts'] = drupal_get_js();
}

now, in your page.tpl.php you can use
print $myquicktab;

Anonymous’s picture

I try to render the quicktabs in a node using the example #1.
I can't get it to load bloack using this example;

$tabs['second'] = array(
  'title' => t('Two'),
  'type' => 'block',
  'bid' => 'my_block_id',
  'hide_title' => TRUE,
);

I think I got the block_id's wrong. Is that supposed to be the ID I see when I edit a block, ore the ID I find in the database (BID). Both don't seem to work.

Pasqualle’s picture

Re #14
oh, that is not that simple. That id is really wrong in quicktabs. (I should have fixed that long time ago. Maybe in the 3.x version.)

        $pos = strpos($tab['bid'], '_delta_');
        $blockmodule = substr($tab['bid'], 0, $pos);
        $blockdelta = substr($tab['bid'], $pos + 7);

format: $module_delta_$bid
example: "user_delta_3" should be the "Who's online" block..

Anonymous’s picture

@ Pasqualle, Thanks for your fast reply. You made my day!!

You can see it in action at www.zookah.com at the homepage.

Thanks!!

Pasqualle’s picture

You are welcome. That page is a nice usage example of quicktabs..
Those login boxes should check additional settings and permissions. For example the Register tab should not be displayed if you disable registration.. But you may easily add that logic as you created the tabs programatically, maybe you already done that..

askit’s picture

I use the codes in #1 in a block (rather than in a node). Each tab refers to some other standard blocks. The codes generate the tabs but there are no contents for the tab.

Anything I shall revise if the codes are used in a block?

Pasqualle’s picture

@askit: can you show a snippet from the code? Did you name the bid correctly, as described in comment #15?

lifter035’s picture

Hi Pasqualle,

Thanks for all the help here. I have one question.

This is how I add tab for example free text type

$tabs['fourth'] = array(
  'title' => t('Four'),
  'type' => 'freetext',
  'text' => 'Hello World',
);

I'm trying to nest few quicktabs into other quicktab instance.
Is this correct way? It doesn't seem to do anything.

$tabs['first'] = array(
  'title' => t('Academics'),
  'type' => 'quicktabs',
  'qtid' => 'academicsqtid',
);

Thanks a million,

Eddie

lifter035’s picture

Just so we don't go back and forward I'm getting some data from view and trying to populate three tabs with nested tabs.
This is the code I'm using:

		$view_result = views_get_view_result('services', $display_id = "default", $args = array(7));
		foreach($view_result as $item){
			$node = node_load($item->nid);
			$academicstabs[$node->nid] = array(
			  'title' => t($node->title),
			  'type' => 'node',
			  'nid' => $node->nid,
			  'teaser' => FALSE,
			  'hide_title' => TRUE,
		   );
		}
		$quicktabsacademics['qtid'] = 'academicsqtid';
		$quicktabsacademics['tabs'] = $academicstabs;
		$quicktabsacademics['style'] = 'Excel';
		$quicktabsacademics['ajax'] = FALSE;

		
			
		$view_result = views_get_view_result('services', $display_id = "default", $args = array(8));
		foreach($view_result as $item){
			$node = node_load($item->nid);
			$studentsstabs[$node->nid] = array(
			  'title' => t($node->title),
			  'type' => 'node',
			  'nid' => $node->nid,
			  'teaser' => FALSE,
			  'hide_title' => TRUE,
		   );
		}
		$quicktabsstudents['qtid'] = 'studentsqtid';
		$quicktabsstudents['tabs'] = $studentsstabs;
		$quicktabsstudents['style'] = 'Excel';
		$quicktabsstudents['ajax'] = FALSE;

		
		$view_result = views_get_view_result('services', $display_id = "default", $args = array(9));
		foreach($view_result as $item){
			$node = node_load($item->nid);
			$staffstabs[$node->nid] = array(
			  'title' => t($node->title),
			  'type' => 'node',
			  'nid' => $node->nid,
			  'teaser' => FALSE,
			  'hide_title' => TRUE,
		   );
		}
		$quicktabsstaff['qtid'] = 'staffqtid';
		$quicktabsstaff['tabs'] = $staffstabs;
		$quicktabsstaff['style'] = 'Excel';
		$quicktabsstaff['ajax'] = FALSE;
	
		
		$tabs['first'] = array(
		  'title' => t('Academics'),
		  'type' => 'qtabs',
		  'qtid' => 'academicsqtid',
		);
		$tabs['second'] = array(
		  'title' => t('Students'),
		  'type' => 'qtabs',
		  'qtid' => 'studentsqtid',
		);
		$tabs['third'] = array(
		  'title' => t('Staff'),
		  'type' => 'qtabs',
		  'qtid' => 'staffqtid',
		);
		
		$quicktabs['qtid'] = 'all';
		$quicktabs['tabs'] = $tabs;
		$quicktabs['style'] = 'Excel';
		$quicktabs['ajax'] = FALSE;
		print theme('quicktabs', $quicktabs);
	

I changed 'type' => 'quicktabs' to 'type' => 'qtabs' looking at the module code.
I tried to print quicktabs genrated by view results and they display ok but they won't nest into the bottom one.

Can't figure out why is this not working :)
Please help

Thanks,

Eddie

Pasqualle’s picture

The problem is that 'qtabs' type works only with quicktabs stored in the database..

Try to change the last quicktab like this:

        $tabs['first'] = array(
          'title' => t('Academics'),
          'type' => 'freetext',
          'text' => theme('quicktabs', $quicktabsacademics),
        );
        $tabs['second'] = array(
          'title' => t('Students'),
          'type' => 'freetext',
          'text' => theme('quicktabs', $quicktabsstudents),
        );
        $tabs['third'] = array(
          'title' => t('Staff'),
          'type' => 'freetext',
          'text' => theme('quicktabs', $quicktabsstaff),
        );
lifter035’s picture

Thanks a lot man :)

You made my day. It's working perfect.

Ed

askit’s picture

Hi Pasqualle, thank you for the hints on block id - that's the cause. I used "block-og-0" (group detail block). QuickTabs works when I change block id to "og_delta_0". Thank you so much!

featherbelly’s picture

Hello,

I am trying to get some quicktabs containing full nodes to render programatically. The node has children (using node hierarchy) and I want to display one of each content type (if present).

The problem is I would like to use AJAX but as soon as I set $quicktabs['ajax'] = TRUE then only the first tab displays the full node and the rest display teasers only...

    // Get all children
    $result = db_query("SELECT nid FROM {nodehierarchy} WHERE parent = ".arg(1)." ORDER BY order_by");
    
    while ( $row = db_fetch_array($result)) {
      $nid = $row['nid'];
      $node = node_load($nid);
      
      // Test for node type
      switch ( $node->type ) {
        
        case 'event_images':
          // Only load one of each type (first one in the results array)
          if(!$tabs['images']){
            $tab = 'images';
            $title = 'Images';
          }
          break;

        case 'event_text':
          if(!$tabs['text']){
            $tab = 'text';
            $title = 'Text';
          }
          break;
          
        case 'event_audio':
          if(!$tabs['audio']){
            $tab = 'audio';
            $title = 'Audio';
          }
          break;
          
        case 'event_video':
          if(!$tabs['video']){
            $tab = 'video';
            $title = 'Video';
          }
          break;
          
        case 'event_publication':
          if(!$tabs['publication']){
            $tab = 'publication';
            $title = 'Related Publication';
          }
          break;
        
        default:
          $tab = '';
          $title = '';
          break;
      }
      
      if($tab != ''){
        $tabs[$tab] = array(
          'title' => t($title),
          'type' => 'node',
          'nid' => $nid,
          'teaser' => FALSE,
          'hide_title' => TRUE,
        );
      }
    }

    $quicktabs['qtid'] = 'eventtabs';
    $quicktabs['tabs'] = $tabs;
    $quicktabs['style'] = 'nostyle';
    $quicktabs['ajax'] = FALSE;
    print theme('quicktabs', $quicktabs);

Is there anything you can see that I'm doing wrong? Thanks in advance.

Pasqualle’s picture

@featherbelly: yes, I can confirm the problem. this is some kind of php weirdness..
use:

'teaser' => 0,

that works..

design.er’s picture

Thanks a lot for the hints in #1. I also read the samples from #21 and tried to reproduce this but failed.
How can I call an existing QuickTab inside a QTab or nest it also programmatically tab by tab inside a QuickTab?

Example:
Tab 1: Info (type: view. works fine)
Tab 2: Media (type: freetext?)
-> Pictures (type: view. How to nest this view inside 'Tab 2: Media' ?)
-> Podcasts (type: view. Here the same questions)
Tab 3: Another info (type: view)

Here my attempt:

    $tabs['first'] = array(
      'title' => $node->title,
      'type' => 'view',
      'vid' => 'my_view',
      'display' => 'block_1',
      'args' => '%1',
    );
    $tabs['second'] = array(
      'title' => t('Media'),
      'type' => 'freetext',
      'text' => theme('quicktabs', $quicktabsmedia),
    );
		$quicktabsmedia['first'] = array(
		  'title' => t('Pictures'),
		  'type' => 'view',
		  'vid' => 'my_picture_view',
		  'display' => 'block_7',
		  'args' => '%1',
		);
		$quicktabsmedia['second'] = array(
		  'title' => t('Podcasts'),
		  'type' => 'view',
		  'vid' => 'my_podcast_view',
		  'display' => 'block_4',
		  'args' => '%1',
		);

		$quicktabs['qtid'] = '13';
		$quicktabs['tabs'] = $quicktabsmedia;
		$quicktabs['style'] = 'Sky';
		$quicktabs['ajax'] = FALSE;
		print theme('quicktabs', $quicktabs); // I think here is something wrong


    $tabs['third'] = array(
      'title' => t('Another info'),
      'type' => 'view',
      'vid' => 'my_view',
      'display' => 'block_6',
      'args' => '%1',
    );

    $quicktabs['qtid'] = '12';
    $quicktabs['tabs'] = $tabs;
    $quicktabs['style'] = 'Sky';
    $quicktabs['ajax'] = FALSE;
    print theme('quicktabs', $quicktabs);

Thanks a lot for your help. :)

Kind regards,
Stefan

Pasqualle’s picture

this should work:

    $tabs['first'] = array(
      ...
    );
        $quicktabsmedia_tabs['first'] = array(
         ...
        );
        $quicktabsmedia_tabs['second'] = array(
         ...
        );

        $quicktabsmedia['qtid'] = '13';
        $quicktabsmedia['tabs'] = $quicktabsmedia_tabs;
        $quicktabsmedia['style'] = 'Sky';
        $quicktabsmedia['ajax'] = FALSE;

    $tabs['second'] = array(
      'title' => t('Media'),
      'type' => 'freetext',
      'text' => theme('quicktabs', $quicktabsmedia),
    );

    $tabs['third'] = array(
      ...
    );

    $quicktabs['qtid'] = '12';
    $quicktabs['tabs'] = $tabs;
    $quicktabs['style'] = 'Sky';
    $quicktabs['ajax'] = FALSE;
    print theme('quicktabs', $quicktabs);
design.er’s picture

Awesome, it works! :) Thank you VERY MUCH! :)

SocialNicheGuru’s picture

i have added a block to a quicktab
now i want to theme that block by changing view-view--...tpl.php file.

Now if I don't change the file, the raw data shows up under the tab
If I do change the file then none of the variables are passed down to the view.

Am I doing something strange/wrong?

Pasqualle’s picture

@activelyOUT:
you have added a block but theming a view? this does not make sense..
why do you see raw data? every view should be themed by default..
passing variables to view and changing the view's template file has no relation..
why did you posted the question in this issue? I do not see anything related in your comment..

please provide more information..

SocialNicheGuru’s picture

juicytoo’s picture

just a comment.

I was using the following to display QT within nodes

    <?php
		$block = module_invoke('quicktabs' ,'block', 'view', 1);
		print $block['content'];
  ?>

Which is better?

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

cheers

dropchew’s picture

Hi juicytoo,

I happened to came across that issue and had tried using devel to compare the performance. Both approach have the same no. of queries and not much diff in time rendering. Maybe other members have a different view on this...

Pasqualle’s picture

Re #33
There is a slight difference between the two:
The first retrieves the quicktab as block, with block title and block content. And you display the block content only.
The second retrieves the quicktab directly.

but if you look into quicktabs_block() function you can see that there is only one step between the first and the second solution.

I would prefer the second, as when I am displaying the quicktab programatically I never need it themed as a block.

CinemaSaville’s picture

Component: Documentation » Miscellaneous
Category: task » support

Hi. This is a fantastic solution, and I got the tabs working in with the php method in the node, my only issue is that if I have a pager for the 2nd or 3rd etc. tab, every time it pages over the first tab appears again thus confusing the user, even though the next page is available when they click the preferred tab. Is there any way to alleviate this issue by keeping the preferred tab visible when the page is clicked? Or is there perhaps a better way of moving the pages over with jquery or something like that. Thanks again. This module rocks!

Pasqualle’s picture

Component: Miscellaneous » Documentation
Category: support » task

@CinemaSaville: I think you are looking for this issue: #248798: Tab reset with page load.

rc2020’s picture

Title: quicktabs inside node » render quicktab programatically
Component: Miscellaneous » Documentation
Category: support » task
Status: Postponed (maintainer needs more info) » Active

subscribing

jdwfly’s picture

Status: Active » Fixed

Create book page at http://drupal.org/node/679148. This was helpful to me and I figured there are many others that would like to know as well.

Please review and update accordingly if I missed something.

Status: Fixed » Closed (fixed)

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

Arkrep’s picture

Thanks Pasqualle..

Just wanted to add for all the other newbies out, make sure you flush the site cash to get this to work.

Steve

ivashrestha’s picture

Hi all,
The quicktabs freetext option didn't work for me when ajax was enabled.

$tabs['0'] = array(
  'title' => t('Hello'),
  'type' => 'freetext',
  'text' => 'Hello World',
);

$quicktabs['qtid'] = 'unique-id';
$quicktabs['tabs'] = $tabs;
$quicktabs['ajax'] = TRUE;
print theme('quicktabs', $quicktabs);

Is there a work around for that. Also even when the ajax is not enabled having more that 2 freetext tabs doesnot work. The first 2 tabs works fine but the third and the others after that doesnot show content at all. Have anyone come across same problem??

Pasqualle’s picture

@ivashrestha: read comment #11

babusaheb.vikas’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

I was trying to create quick tab dynamically for drupal 7 and i read so many thread or post . I looked into module and found the code to create it dynamically on page





 $tabs = array(
    array('title' => t('One'), 'contents' => array('#markup' => t('First tab')), 'weight' => 0),
    array('title' => t('Two'), 'contents' => array('#markup' => t('Second tab')), 'weight' => 1),
    array('title' => t('Three'), 'contents' => array('#markup' => t('Third tab')), 'weight' => 2)
  );


 

// in 7.x-3.0-beta1, it uses name not id
// quicktabs name available in admin interface: admin/structure/quicktabs
$qtname = 'test2qtab';
$overrides = array('style' => 'Excel', 'sorted' => TRUE, 'ajax' => FALSE);
print drupal_render(quicktabs_build_quicktabs($qtname, $overrides ,$tabs));



Put above code in any page and it would create tabs dynamically.
Please mind changing the $qtname = 'test2qtab'; put your qtname here.

japerry’s picture

It seems that upgrading from 2.x to 3.x has caused blocks to be hidden even when the block is selected...

//set tab content
$tabs['first'] = array(
'title' => t('First'),
'type' => 'block',
'bid' => 'my_block_delta_first',
'hide_title' => TRUE,
);
$tabs['second'] = array(
'title' => t('Second'),
'type' => 'block',
'bid' => 'my_block_delta_second',
'hide_title' => TRUE,
);
$tabs['third'] = array(
'title' => t('Third'),
'type' => 'block',
'bid' => 'my_block_delta_third',
'hide_title' => TRUE,
);
$quicktabs['qtid'] = 'page_details'; // machine readable name
$quicktabs['hide_empty_tags'] = TRUE; // hide tabs that are empty
$quicktabs['default_tab'] = 'stats'; // set the default tab
$quicktabs['tabs'] = $tabs; // all tabs with content
$quicktabs['style'] = 'default'; // tabs theme
$quicktabs['ajax'] = FALSE; // ajax or not
$block = array('subject' => '', 'content' => theme('quicktabs', $quicktabs));
return $block;
break;

andes1’s picture

Status: Closed (fixed) » Active

I am working with Quicktabs on Drupal 7 and i want my quicktabs on page.tpl.php or page--mypage.tpl.php.
I write code on template.php :

<?php

 function th_milk_preprocess_page(&$variables) {
	         $get_quicktabs = quicktabs_load('recruitment_quicktabs');
  	         $variables['myquicktab'] = theme('quicktabs', $get_quicktabs);
              }

       ?>

and on page.tpl.php :

<?php print $myquicktab; ?>

still i am not getting the quicktabs. i can get the whole array if i print $get_quicktabs. but not along with theme.

could not check why its not working?

jdwfly’s picture

Status: Active » Closed (fixed)

Please open new issue for help @active_cyber. This issue was fixed when the documentation was created.

Pasqualle’s picture

for Drupal 7 try:
qt from database; (http://drupal.org/node/679148#comment-4712456)

   $quicktabs = quicktabs_build_quicktabs('recruitment_quicktabs'); // use your qt name here 
   print render($quicktabs);

qt from code:

   $quicktabs = quicktabs_build_quicktabs('custom_qt_name', array(), $custom_tabs);
   print render($quicktabs);

see quicktabs_build_quicktabs() function for more details..

bserem’s picture

#44 and #48 were quite helpfull in adding a Quicktab programmatically in D7 and QT3

I am having troubles displaying a node or another quicktab inside one of the tabs however. Is this possible programmaticaly or only text is available?

Steve Dondley’s picture

What's the easiest way to grab the quicktabs ID. Query the database?

Steve Dondley’s picture

Disregard last. It's not a numerical id but the machine name of the quicktab.

jbova’s picture

@bserem,
You may show a node, view, or block inside of a quicktab by changing the type. I'm unsure about nesting quicktabs. Here is an example showing four tabs that each load a distinct view.

    $tabs = array(
      array(
        'title' => t('Overview'),
        'type' => 'view',
        'vid' => 'product_tabs',
        'display' => 'block_1',
        'args' => $node->nid,
        'weight' => 0,
      ),
      array(
        'title' => t('Dimensions & Weight'),
        'type' => 'view',
        'vid' => 'product_tabs',
        'display' => 'block_4',
        'args' => $node->nid,
        'weight' => 1,
      ),
      array(
        'title' => t('Shipping'),
        'type' => 'view',
        'vid' => 'product_tabs',
        'display' => 'block_2',
        'args' => $node->nid,
        'weight' => 2,
      ),
      array(
        'title' => t('Ratings & Reviews (' . $node->comment_count . ')' ),
        'type' => 'view',
        'vid' => 'product_tabs',
        'display' => 'block_3',
        'args' => $node->nid,
        'weight' => 3,
      ),
    );
    $qtoptions = array(
      'style' => 'Zen',
      'ajax' => FALSE,
    );
    $qtname = 'commerce_product';
    $quicktabs = quicktabs_build_quicktabs($qtname,$qtoptions,$tabs);
    print drupal_render($quicktabs['content']);

The "type" key must be set to "view". The "vid" key is the view id. The "display" key is the id of the display in your view. The "args" key are any optional arguments that your view may expect. If you want to style the quicktab, the id of the div container will be quicktabs-$qtname. So, in this example, the id is quicktabs-commerce_product.

Here is an example of a loading a node and block into quicktabs:

$tabs = array(
  array(
    'title' => t('Node ID 1'),
    'type' => 'node',
    'nid' => '1',
    'teaser' => TRUE,
    'hide_title' => TRUE,
  ),
  array(
    'title' => t('Block'),
    'type' => 'block',
    'bid' => 'my_block_id',
    'hide_title' => TRUE,
  ),
);
eliasdelatorre’s picture

At the comment #14:
I guess it will make the code clearer to set the format as:

$module_delta_$delta

given that the blocks table has a bid field and a delta field, delta is the one with the name of the block.

So for example, I created a new box (a box is the same as a block, just that a box can be exported on a feature) and I want to put that block into a tab, I went to MySQL and selected all the fields, and my result was:

+------+--------+---------------------+
| bid  | module | delta               | 
+------+--------+---------------------+
| 1817 | boxes  | sponsor_home        | 
+------+--------+---------------------+

So my 'bid' field should be:

'bid' => 'boxes_delta_sponsor_home',

Cheers!

jackbravo’s picture

In case you have trouble displaying the tabs in D7, be sure to include the 'args' parameter for views, even if it is empty.

rudetrue’s picture

Thank you #44, that was the only example I've found that is working to add quick-tabs to a node template and render fields inside of them. Your post saved me a lot of time and monotonous work.

foagth’s picture

You nailed it @eliasdelatorre at #53. I was close but you gave the crystal clear explanation.
I was trying to find where the actual integer 'bid' from the db should go.

mattrweaver’s picture

Thanks eliasdelatorre, this explains it, and I finally sorted out my block id!

lameei’s picture

Issue summary: View changes

Here is My case:
I have a Quicktab with 2 tabs. The block is placed in user profile. Now I want to show one of the blocks only when the user visits his own profile and hide it when he is visiting other profiles. How may I do this?