Hello,

A stable Drupal 7 version is planned to be released on 5. January.
I'd like to ask when you plan to upgrade the Tab Tamer module to Drupal 7. I'd love to use it on my first D7 projects. :)

Stefan

CommentFileSizeAuthor
#41 tabtamer-D7-upgrade-1007226-40.patch13.92 KBAnonymous (not verified)
#41 tabtamer-D7.zip4.83 KBAnonymous (not verified)

Comments

coreyp_1’s picture

I think the port to D7 is almost done. a few changes to the menu structure are giving me a headache...

design.er’s picture

Ok, feel free to let me know if you need a tester and hank you very much for your time & work. :)

Traphic’s picture

Great, looking forward to taming these tabs on D7, what a neat module.

KeesMK’s picture

Goodluck coreyp_1 this is indeed one of the options the core Drupal is missing.

KirstenLangholz’s picture

I would love to have it for my new D7 release, too. Is there anything to test already?

Shadlington’s picture

Subscribing

sw3b’s picture

Subscribing

thomas1977’s picture

Subscribing

KirstenLangholz’s picture

I think the port to D7 is almost done. a few changes to the menu structure are giving me a headache...

Two months later, would you please give us an update on how far you are. We are all willing to test, if you give us something to test ;)

srsbl’s picture

Subscribing

dopedwizard’s picture

subscribing.

nonom’s picture

subscribe

achillesp’s picture

subscribing

TimelessDomain’s picture

Title: Upgrade to Drupal 7 » Drupal 7 port of Tab Tamer
Issue tags: +drupal 7 port

if this module has to be re-written at all -> you should mod it so that we can integrate it with the context module - details are outlined here #945202: Integration with Context - Control Tabs Based On Role, Taxonomy, Content Type, CCK, Rules, and Actions

grahamtk’s picture

Subscribe :)

kevinedmister’s picture

subscribing

tbeauchemin’s picture

subscribing

Desi Raaj’s picture

any update on the D7 port?

Starminder’s picture

+1

Clive@onebrick.org’s picture

+1

jdflorez’s picture

suscribe

Anonymous’s picture

If you just want to remove the tabs HTML for specific tabs, you can use the code below. $unwanted_tabs contains an array of your unwanted paths. Remember, access is not blocked. It only removes the tab from your page HTML.

/**
 * Implementation of hook_preprocess_page().
 */
function mytheme_preprocess_page(&$variables) {

  // Tab Tamer
  $unwanted_tabs = array('user/%/invites', 'user/%/shortcuts', 'user/%/relationships/1', 'user/%/track', 'user/%/contact', 'user/%/devel', 'node/%/devel');
  foreach ($variables['tabs'] as $group_key => $tab_group) {
    if (is_array($tab_group)) {
      foreach ($tab_group as $key => $tab) {
        if (isset($tab['#link']['path']) && in_array($tab['#link']['path'], $unwanted_tabs)){
          unset($variables['tabs'][$group_key][$key]);
        }
      }
    }
  }
}

Put it in template.php. Change function mytheme_ to your theme code & refresh cache..

deeve’s picture

..am slightly confused; will this template.php code work independently in 7.x or do we have to wait for Tab Tamer 7.x full release?

toxiclung’s picture

subscribe

Anonymous’s picture

@deeve my snippet works stand-alone

deeve’s picture

@morningtime - perfect!
'node/%/view', 'node/%/edit', 'node/%/log' - worked a treat :)
Many thanks!

sw3b’s picture

@morningtime thanks !

ann_meredith’s picture

Thanks @morningtime for the code and clear instructions on how to implement. Still would love to see Tab Tamer for D7.

molave’s picture

@morningtime Thanks, this worked great and helped me a lot.

Reminder to fellow non-techs: if you already have the mytheme_preprocess_page function in your template.php file, don't copy and paste the code at #22 in its entirety anymore. Instead, copy just the following snippet into the existing function (remove the opening and closing php tags):

<?php
 
 // Tab Tamer
  $unwanted_tabs = array('user/%/invites', 'user/%/shortcuts', 'user/%/relationships/1', 'user/%/track', 'user/%/contact', 'user/%/devel', 'node/%/devel');
  foreach ($variables['tabs'] as $group_key => $tab_group) {
    if (is_array($tab_group)) {
      foreach ($tab_group as $key => $tab) {
        if (isset($tab['#link']['path']) && in_array($tab['#link']['path'], $unwanted_tabs)){
          unset($variables['tabs'][$group_key][$key]);
        }
      }
    }
  }

?>

Finally, if your existing function uses $vars instead of $variables, change the above code to adapt to what's already there.

Thanks, of course, to maintainer coreyp_1 for this module.

bryancasler’s picture

subscribe

mrfelton’s picture

Snippet in #29 does the job for me. Thanks.

manu.joseph’s picture

morningtime Thankz...

Fidelix’s picture

Subscribing...
This module is great.

TallDavid’s picture

Sitting in the "Freelancing with Drupal" session at Dallas Drupal Days and the presenter is complaining that this module still doesn't have a Drupal 7 port. ;-)

Thought I'd subscribe.

P.S. Hi Corey!

pgough’s picture

subscribe

Sylense’s picture

sub

kerios83’s picture

sub

TimelessDomain’s picture

#22 works - but if there is only 1 tab left (after removal of other tabs), it does not remove that.
For ex. w/ drupal Commerce a "products" tab appears on all nodes for all roles, hiding this tab works, but then the "view" tab is still visible. I do not want to remove the "view" tab for all roles.

Starminder’s picture

+1

Ingmar’s picture

Want to follow this as well.

Anonymous’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Active » Needs review
StatusFileSize
new4.83 KB
new13.92 KB

Attached is a working patch for the full upgrade from Tab Tamer 6.x-1.x to 7.x-1.x. And also the full zip file.

I hope the maintainer can apply the patch soon and create the D7 branch. I'm also willing to co-maintain this, if needed. Just let me know. This upgrade is sponsored by Morningtime, a Drupal shop from Europe/Germany.

I included a new README.txt to explain the following:

Tab Tamer lets you hide, disable and re-order all Drupal menu tabs.

 - Enable the module as usual and find the configuration at:
   /admin/config/tabtamer
   /admin/config/tabtamer/tabs
   /admin/config/tabtamer/settings

 - After making changes, you must 'Clear all caches' under Performance
   in order to reflect your changes.

 - By default the administrative tabs are not shown. You can enable this
   feature under the Settings tab. As the Tab Tamer list is cached,
   you need to 'Clear all caches' when disabling or enabling this feature
   in order to reflect your choice.
Ingmar’s picture

Great!
I'm trying to use it on a 7 - version.
I have installed the module and applied the patch as well.

Now...I seem to be able to reorganize tabs within the same 'group' (in my case User/%).
But is it possible to get a tab from another group ( profile-mail/%) into the User-group?

In other words; how do I add a tab to a group OR edit the path of an existing tab?

Anonymous’s picture

I wrote the maintainer, but he has not responded yet. We'll have to wait for that.

Adding tabs: can be done with Views, Panels or a custom hook_menu() implementation. Then you can organize the new tabs with Tab Tamer.

Editing paths is a feature-request we can look into.

davidwhthomas’s picture

@morningtime

The D7 module looks good, but given that most of the code is for /admin

The hook_menu should use a tabtamer.admin.inc file to include that code, as per Drupal best practice.

That way, the code isn't loaded for users browsing the front end, much better for performance.

e.g

<?php
/**
 * Implements hook_menu().
 */
function tabtamer_menu() {
  $items = array();

  $items['admin/config/tabtamer'] = array(
    'title' => 'Tab Tamer',
    'access arguments' => array('administer tabtamer'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('tabtamer_tabs_form'),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'tabtamer.admin.inc', // admin code goes in here
  );
  /* other menu items the same ... */

  return $items;
}
?>

cheers,

DT

Anonymous’s picture

Thanks for the suggestion. Good idea. I'm waiting for the module maintainer to get back to me. Or maybe I can apply for co-maintainership to manage the D7 module. Would be happy to do so.

CarbonPig’s picture

subscribe - this module is awesome in D6 and I can't wait to test the D7 version!

coreyp_1’s picture

sorry everyone, I'll get something out this weekend.... I haven't forgotten, but I'm a full-time college student with 3 jobs, so this has unfortunately been getting pushed back.

Anonymous’s picture

Hi coreyp_1, will you have time for this? I offered to co-maintain the D7 branch. Let me know if you want me to do so, I don't mind.

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

Ok guys, I will very soon start the 7.x branch and will co-maintain it. Just a little more patience. Many thanks to Corey!

Anonymous’s picture

Status: Reviewed & tested by the community » Fixed

Ok, I've comitted the 7.x branch!
http://drupalcode.org/project/tabtamer.git/commit/349a458

It should be up in 24h as a regular download on the project page.

kerios83’s picture

Great news !

CarbonPig’s picture

Awesome - thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

geerlingguy’s picture

FYI, in Drupal 7, you can simply use fn_notes_menu_local_tasks_alter() to do this without needing an extra module.

Something like this would simply remove the 'View' tab from 'note' node types:

/**
 * Implements hook_menu_local_tasks_alter().
 */
function fn_notes_menu_local_tasks_alter(&$data, $router_item, $root_path) {
  // For note nodes, remove the 'View' tab when viewing the node.
  foreach ($router_item['page_arguments'] as $key => $argument) {
    if (is_object($argument) && $router_item['page_arguments'][$key]->type == 'note') {
      foreach ($data['tabs'][0]['output'] as $key => $value) {
        if ($value['#link']['path'] == 'node/%/view') {
          unset($data['tabs'][0]['output'][$key]);
        }
      }
    }
  }
}
davidwhthomas’s picture

If you just want to remove the 'View' tab in general, you could probably also do something like this:

/**
 * Implementation of hook_menu_alter
 */
example_menu_alter(&$items){
  if (isset($items['node/%node/view'])) {
    $items['node/%node/view']['type'] = MENU_CALLBACK;
  }
}

DT

KirstenLangholz’s picture

Thanks guys for this code snippets!

snehi’s picture

Version: 6.x-1.1 » 7.x-1.1
Component: Code » User interface
Category: task » feature
Status: Closed (fixed) » Active

can i choose tab by role ?

Anonymous’s picture

Status: Active » Closed (fixed)

Please open a new issue. There is already this one: #1326382: Add access callback contingencies for Context, PHP, Rules, Admin etc., it's currently not possible to do it.