Community & Support

Remove tabs completely from search results page, and user pages

I've been searching but can't seem to find a solution to my problem. I want to COMPLETELY remove the view tabs that appear when someone searches for a term. I found template.php overrides to remove certain tabs, and I managed to remove everything. But then I am left with the two lines and spacing associated with the tabs. So the tab wrapper is there, but the tabs themselves don't appear.

I could remove them via CSS (by using display: hidden;) but that would mean that they're still loading, which is bad practice. But also, I couldn't do it because there isn't a class for that particular set of tabs. Any attributes I associate with that class, will be applied to all of the instances of the tabs across the entire website.

I've also tried creating my own customsite module, but it has been ineffective.

Once I find a way to remove the tab wrapper, I'll apply it to several pages, mainly the search results and the user profiles. Thank you all very much.

Comments

Tab Tamer

The Tab Tamer module should be able to help with that.

Thanks, but problem with Tab Tamer

Thanks a lot. Tab tamer seems like the perfect tool. Ironically, I've managed to (easily) remove the tabs from appearing on any of the pages across the website, EXCEPT for the search pages.

For some odd reason, when I change the options with the last three choices (search/node/%, search/users/%, search404) at the very bottom of the list, after saving, they go back to being "enabled". I've tried several times, and every time I save, they're not changed. I've also tried clearing caches, but the problem persists. Could this be a bug, or a conflict with another module, or preprocess functions overridden in the template.php file?

Thanks a lot for your help.

UPDATE: In fact, even when I try to change the order of any of the last three items, it reverts back to the original order, my changes are not saved. Also, I disabled a Custom Site module that I had made in an attempt to remove the tabs, but Tab Tamer is still giving me problems with the last items.

Tarek Shalaby

Sounds like something you

Sounds like something you might want to submit to the module's issue queue.

Submitted bug report

Thanks a lot for your help, Matt.

I've started a bug report issue for the Tab Tamer module here: http://drupal.org/node/605286

I'll update this conversation as soon as there are developments on the other end.

Tarek Shalaby

No response from Tab Tamer. Other options?

So I haven't heard back after filing the bug report, and I don't think I'll be hearing back anytime soon. Having said that, are there any other options? There's got to be ways in which I can remove those tabs, right?

Thank you very much.

Tarek Shalaby

hook_menu_alter

In your custom module, inside a hook_menu_alter implementation, you could try using unset to remove the tabs from the menu hierarchy or change the type designation to MENU_CALLBACK.

This hides all tabs from

This hides all tabs from anonymous users.

In page.tpl.php:

<div class="tabs">
<?php global $user;
if (
$user->uid){?>

<?php print $tabs ?>
<?php } ?>
</div>

It worked!

WOW, that was so easy. All I did was paste that code in page.tpl.php (and commented out the default code lines for displaying the tabs) and voila! No tabs appear for any anonymous users.

So the ideal solution is to use that code, but also use the Tab Tamer module to control which tabs the authenticated users see. Perfect.

Thank you very much Matt V. and Shaman.

Tarek Shalaby