How to Remove unwanted tabs in Drupal 6

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


In Drupal 6, you can remove unwanted tabs by using following function in template.php:


<?php
function yourthemename_preprocess_page(&$vars) {
  
// Remove undesired local task tabs.
  // This first example removes the Users tab from the Search page.
  
yourthemename_removetab('Users'$vars);
}
?>


<?php
// Remove undesired local task tabs.
// Related to yourthemename_removetab() in yourthemename_preprocess_page().
function yourthemename_removetab($label, &$vars) {
  
$tabs explode("\n"$vars['tabs']);
  
$vars['tabs'] = '';

  foreach (
$tabs as $tab) {
    if (
strpos($tab'>' $label '<') === FALSE) {
      
$vars['tabs'] .= $tab "\n";
    }
  }
}
?>





Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.