I'm not sure if I've got this right, but I think admin_menu shouldn't create a link for a MENU_DEFAULT_LOCAL_TASK using its item key. It should default to the first parent which is not a default local task (From the Drupal API).

The recipe module adds a tab to the: Create Content -> Recipe(node type) menu using

function recipe_menu_alter(&$items) {

  // Add a tab on the recipe add screen for Recipe Import.
  $items['node/add/recipe/std'] = array(
    'title' => 'Standard entry',
    'weight' => 0,
    'type' => MENU_DEFAULT_LOCAL_TASK
  );
  $items['node/add/recipe/import'] = array(
    'title' => 'Recipe Import',
    'description' => 'Allows you to create a recipe by pasting various formats into a big text box.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('recipe_import_form'),
    'access callback' => 'recipe_import_access',
    'access arguments' => array('import recipes'),
    'weight' => 1,
    'type' => MENU_LOCAL_TASK
  );
}

The way I read the API, the Create Content -> Recipe ->Standard entry tab should actually be resolved with "node/add/recipe" and not "node/add/recipe/std".

CommentFileSizeAuthor
#6 admin_menu.skip-items.6.patch4.43 KBsun

Comments

sun’s picture

Title: admin menu should not expose link to MENU_DEFAULT_LOCAL_TASK item » Do not output default local tasks
Version: 6.x-1.6 » 7.x-3.x-dev
Category: bug » task

Going to revisit this for 3.x.

Now that we've implemented dynamic expansion of router items, we can evaluate better whether it makes sense to list dynamically added items/entities below the tab_parent (e.g., below "Menus") or the default local task (e.g., below "Menus" » "List").

sun’s picture

It's time to actively revisit this issue. +1 from me.

sun’s picture

sun’s picture

sun’s picture

Issue tags: +GoogleUX2012
sun’s picture

Status: Active » Needs review
StatusFileSize
new4.43 KB

Attached patch skips all MENU_DEFAULT_LOCAL_TASK and MENU_VISIBLE_IN_BREADCRUMB items, and proves that with a test.

The second part apparently fixes #1428578: Links under top-level Help are confusing in one shot.

sun’s picture

Status: Needs review » Active

Committed to all 3.x branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

That said, minor regression:

If a default local task has more than one child link, then it should not be skipped.

sun’s picture

Status: Active » Fixed

That said, it looks like that regression only exists in D6's IA, so let's call this fixed.

Status: Fixed » Closed (fixed)

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

KingMoore’s picture

Interesting. All of a sudden my MENU_DEFAULT_LOCAL_TASKs are not showing up in my admin menu. Any way to force one to show? That is how I wanted it.

sun’s picture

Nope, there's no much to bring them back.

This was almost the top No.1 problem for Administration menu users in the Google Usability Study 2012, and the users were seriously confused by those additional links pointing to the same location.

Thus, this change is backed by formal usability testing, which also means that I don't see a need for adding an option to toggle default local task appearance. Retrain your habits instead ;-)

Lastly, this also has a technical component to it -- skipping local tasks in the menu tree makes the entire menu significantly smaller.

KingMoore’s picture

Fair enough, thanks. If only I wasn't such an old dog.

KingMoore’s picture

Thinking about it... I have a page with 3 tabs. What I want in admin menu is one "container" type link and then 3 sub links. Is there any way to make the top level page not a default local task, and then have each of the 3 tabs show up under it? hmmmm Maybe I need to make the top level container page a 4th tab in order to achieve this, but not sure what that tab should be. Hmmmmmmmm