Most people using Features probably use Admin Menu as well, and it would be great to have links to each individual features in there, even if just to be able to bypass the features listing page.

Admin Menu provides hook_admin_menu_map() to do that. The implementation for features would look like this:

/**
 * Implements hook_admin_menu_map().
 */
function features_admin_menu_map() {
  if (!user_access('administer features')) {
    return;
  }

  $map['admin/structure/features/%feature'] = array(
    'parent' => 'admin/structure/features/',
    'hide' => 'admin/structure/features/manage',
    'arguments' => array(
      array(
        '%feature' => array_keys(features_get_features()),
      ),
    ),
  );

  return $map;
}

Before you get too excited, the code above doesn't work yet. The array returned by the hook is correct, but the entries are then discarded by admin_menu because there are no corresponding in the menu_links table. The same problem is affecting the admin_menu integration for views too, so this might be an issue with admin_menu.

Comments

mpotter’s picture

Status: Needs work » Closed (won't fix)

Closing this for lack of activity. Please re-open this issue if you can reproduce it in the latest version.

joachim’s picture

Issue summary: View changes
Status: Closed (won't fix) » Active

> the entries are then discarded by admin_menu because there are no corresponding in the menu_links table

I'm not sure that's the reason -- Flag module doesn't have specific entries in menu_links either.

Might try to look at this if I have time.

mpotter’s picture

We don't typically add specific 3rd party module integration like this. If there is a bug in Features that prevents something from working, then we can leave this open, otherwise this will go back to won't-fix.

joachim’s picture

Lots of contrib modules add an implementation of this hook in order to provide better support for admin_menu. It's a big improvement to UX to be able to go directly to the feature that you want to work with -- especially when you consider that the main Features admin UI can take a long time to load!