I'm looking to get rid of the "all" tab and replace it with a tab containing a custom block..
Or keep it and add the new tab (probably get rid of it though..)
I am not sure how to do this, (although I'm thinking it shouldn't be too difficult) I'm thinking some change to this function:
/**
* Generate a renderable group widget.
*/
function commons_bw_generate_group_widget($group) {
$settings = array('style' => 'Commons Pills', 'ajax' => FALSE, 'html' => TRUE);
// Load the default tab definitinos.
$tabs = commons_bw_get_tab_definitions('group');
foreach ($tabs as $key => $tab) {
// Populate the group argument.
$tabs[$key]['args'] = $group->nid;
// Add the result count for Tabs that are of the type 'view';
if ($tab['type'] == 'view') {
$view = views_get_view($tab['vid']);
if (isset($tab['display'])) {
$view->set_display($tab['display']);
}
$view->set_arguments(array($group->nid));
$view->get_total_rows = TRUE;
$view->execute();
$tabs[$key]['title'] = t($tabs[$key]['title']) . ' <span class="commons-bw-result-count">'. $view->total_rows . '</span>';
}
// Set the default tab.
if (isset($tabs[$key]['default']) && $tabs[$key]['default']) {
$settings['default_tab'] = $key;
}
}
// Generate the Quicktabs instance.
return quicktabs_build_quicktabs('commons_bw', $settings, $tabs);
}
any pointers would be appreciated..
Comments
Comment #1
J77J commentedThis has me beat...
I have tried following the instructions here:
https://drupal.org/node/1782922
To no avail.. I even copied the entire commons_posts folder to my new module, swapping out "posts" for my content type...
Nothing.
The new content type shows in the all tab, I just cant get another tab with that type to show..
Anyone have any ideas?
Comment #2
J77J commentedComment #3
Laz5530 commentedWith this can you create a new tab in BW and link it to you view.
The whole thing is pretty complecated. And theres no Description :(
/**
* Implements hook_commons_bw_group_widget().
*/
function YOURMODUL_commons_bw_group_widget() {
return array(
'YOUR_MODUL' => array(
'title' => 'TITLE_OF_TAB',
'type' => 'view',
'vid' => 'YOUR_VIEW(computer readable name)',
'display' => 'default',
'weight' => 1,
),
);
}
I hope it helps.
Comment #4
Laz5530 commentedHi,
i have seen many have the problem adding custom tab to the browsing widget.
I had this problem too and found no documentation (just this issue). So after i solved this i thought i share it with you.
Here is an example module for a custom tab for custom contenttype.
Comment #5
Anonymous (not verified) commentedHi,
I'm working with the same task, but I don't want to create new view for my tab. So if I just make implements hook_commons_bw_group_widget() I can create tab with various type, for example, with next code:
But at the page with this quicktabs I have the notice:
Notice: Undefined index: type in function commons_bw_generate_group_widget() (line 84 in file \profiles\commons\modules\contrib\commons_bw\commons_bw.module
so maybe it's helpful to make patch with correct check type for creating different types of quicktabs not only views?
Comment #6
devin carlson commentedMarked #2129517: Step By Step Guide: How To create your custom Group Content Type and its Browsing Widget Tab as a duplicate.
Comment #7
ceepeebee commentedThere are several ways how you could get rid of the "all" tab:
1. tell commons not to create it in the first place: you would have to alter the commons_bw.module source code and you don't want to do that
2. write your own module
3. fastest approach: use css just for not showing the tab: (be aware the functionality stays accessible)
Comment #8
ceepeebee commentedI know, this issue is the original and strictly speaking #2129517: Step By Step Guide: How To create your custom Group Content Type and its Browsing Widget Tab is the duplicate, but the latter seemed to be the proper place to put a step-by-step how-to (considering the fact that it was re-opend anyways).
marking this one as fixed