I'm working on a project where I need to create over a hundred nodes each with a unique quicktab. Trouble is all the blocks this is creating is fast making the block admin page unmanageable. Is there a way for me to create a quicktab without it creating it's corresponding block?

I was going to place my quicktabs with the snippet of php below, so I really have no use for the blocks anyway.

<?php
$qtid = 42; // write here your quicktabs id.
$quicktabs = quicktabs_load($qtid);
print theme('quicktabs', $quicktabs);
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

netw3rker’s picture

Version: 6.x-3.1 » 7.x-3.x-dev
Category: Support request » Feature request
Issue summary: View changes

This might be a better feature request. Instead of automatically creating a QT-Block, allow for an option to make it a block. This will keep the list much smaller. There are also a bunch of issues surrounding machinenames that are longer than the block delta field. that should maybe be rolled into this too

vbouchet’s picture

Status: Active » Needs review
FileSize
2.84 KB

If you really don't need any quicktabs block, you can very easily hide it via the hook_block_info_alter() and unset($blocks['quicktabs']);

It's probably only a workaround as it may be more complex to filter if you want to have some quicktabs blocks and hide some other. Please find a patch which add a check box in quicktabs creation/edit form, store the result in the option column (serialized array) and finally filter quicktabs blocks on the block admin page. I also introduced a hook_update to set a value in the option column for all existing quicktabs.

Regarding the machine name longer than the block delta field, it's currently using the machine_name option so even a very long title is trimmed to fit into the delta field.

Edit: After few more tests, I can see a potential issue with the patch if a quicktabs block is placed in a region, then the quicktab is edited to not create the related block. The block is not listed anymore in the block admin page but the related block remains in the database and configured. What would be the best solution? Disable the check box when the block is placed in a region? Delete the block when the check box is unchecked ?