How to show only populated menu tabs in Drupal?
In evaluating the [Invite][1] and [Support][2] modules for Drupal recently, we realized the default tab navigation is not the most user friendly. In particular, each module has a page of tabs that show the various categories of invitations or support tickets (pending, cancelled, etc). For  developers, it's easiest to pre-define all the tabs, but from a user standpoint, it makes more sense to only be offered the tabs that contain content.

I assume it's possible to run queries to check which tabs should be displayed for a particular user and change the menus using [hook_menu_alter][3]. However, is that the best way to do it or will that cause problems with Drupal's menu caching? Is there a better way?


  [1]: https://drupal.org/project/invite
  [2]: https://drupal.org/project/support
  [3]: http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_menu_alter/6
How to show only populated menu tabs in Drupal?
===

In evaluating the [Invite][1] and [Support][2] modules for Drupal recently, we realized the default tab navigation is not the most user friendly. In particular, each module has a page of tabs that show the various categories of invitations or support tickets (pending, cancelled, etc). For  developers, it's easiest to pre-define all the tabs, but from a user standpoint, it makes more sense to only be offered the tabs that contain content.

I assume it's possible to run queries to check which tabs should be displayed for a particular user and change the menus using [hook_menu_alter][3]. However, is that the best way to do it or will that cause problems with Drupal's menu caching? Is there a better way?


  [1]: https://drupal.org/project/invite
  [2]: https://drupal.org/project/support
  [3]: http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_menu_alter/6