/ Published in: PHP
                    
                                        
Was trying to figure out a way to remove tabs for a content type where it was unnecessary. Place this in your theme template.php file and configure to your needs.
Example Usage: Organic Group View is created and page uses a menu tab. Unfortunately the tab gets added to all other content types. This is used to remove that tab for the other content types that aren't part of your group.
                Example Usage: Organic Group View is created and page uses a menu tab. Unfortunately the tab gets added to all other content types. This is used to remove that tab for the other content types that aren't part of your group.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
/*
*Removes Tabs From Specific Content types.
*/
<?php
function phptemplate_preprocess_page(&$variables, $hook) {
$node = node_load($nid);
if($node->type == 'project') {
theme_removetab(t('Edit'), $variables);
theme_removetab(t('View'), $variables);
theme_removetab(t('Outline'), $variables);
}
}
function theme_removetab($label, &$vars) {
$vars['tabs'] = '';
foreach($tabs as $tab) {
$vars['tabs'] .= $tab . "\n";
}
}
}
?>
URL: http://groups.drupal.org/node/67463
Comments
 Subscribe to comments
                    Subscribe to comments
                
                