The Admin Toolbar was added to core in Drupal 7. In earlier versions of Drupal, there were several modules that added similar administrative interfaces, including the Admin Menu and Admin module. While those modules are also available for Drupal 7, some of the advantages of using the core Admin Toolbar are:

  • Well Supported.  Because it's part of core it is more likely to play nicely with other modules like CiviCRM.
  • Your site matches screenshots and documentation on Drupal.org.  
  • It provides a visual separation of staff navigation from producer, self-service navigation.

The Shortcut bar is the lighter grey toolbar immediately underneath the Admin Toolbar.

Customizing the Admin Toolbar

The first reason to Customize the Admin Toolbar is usability. If you try to add every possible option at the highest level, the Admin Toolbar ends up wrapping and isn't covered by CiviCRM's admin options. If you leave a link to the Admin menu itself http://yoursite.com/admin in the Admin toolbar, al the shortcuts will be one click away.

The logic is to move items that most staff users never see down to Shortcuts and reorder the other menus into the most logical order.

Most Community Media sites make changes to the default Drupal configuration that result in an Admin Toolbar with options similar to this:

People | Projects | Reservations | Shows | Structure | Configuration | Help | CiviCRM

The menu items that appear in the Admin Toolbar are limited to users in a role with permission to use at least one of the menus under a menu at the top level.  These menu options can be renamed, enabled, disabled, added, or reordered by going to Structure > Menu > Management

but doing so will also affect the main Admin menu at http://yoursite.com/admin, so while you can use this approach the following method is preferable.

Hiding items in Admin Toolbar without changing menu structure

The Admin Toolbar will be displayed to some users who don't need to use every link; Dashboard and Appearance are both useful, but it is unlikely anyone other than the site admins would use them.

  1. Install and enable the CSS Injector module
  2. Go to Admin > Configuration > Development > CSS Injector
  3. Click Create a new rule
  4. Give your rule a name, e.g. "Hide Admin Toolbar Menus"
  5. Enter the CSS code to mask the menu items you don't want to display, this example code masks the Structure, Content, Configuration and Reports links respectively.
    .path-admin-structure, .path-admin-content, .path-admin-config, .path-admin-reports{
      display: none;
    }

    Add or subtract links by using the Check Element option or a utility like Firebug in your browser to work out the CSS names for further menu options in the Admin Toolbar, and then adding them before the {. Here are other potentially useful ones to mask:

    • path-admin-dashboard
    • path-admin-appearance
    • path-admin-people
    • path-admin-modules
    • path-admin-config

Moving Menus from the Admin Toolbar to Shortcuts

By default, there are two links in the Shortcut bar: "Add content" and "Find content." To add and edit shortcuts, click the "Edit shortcuts" link on the right of the toolbar.

While each user can customize links in this way, we recommend creating a different set of shortcuts for significant roles on your site, e.g., producers, interns, staff, admins. This way, each role always has easy access to essential links they need without extraneous ones.

For staff, this might look like:

  • HOME
  • Add Class
  • Add Producer
  • Add Project
  • Add Show
  • Make Reservation
  • Reservation Calendar
  • People
  • Register Class Participant
  • Search Contacts

For Admins:

  • Add content
  • Find content
  • Appearance
  • Configuration
  • Content
  • Devel Dashboard
  • Modules
  • Reports
  • Reservations
  • Structure

Configure Shortcut Bars

  1. Go to Administration > Configuration > User interface > Shortcuts
  2. Click Add shortcut set
  3. Name the Shortcut set for the Role it will be for, e.g. "Staff"
  4. Click Add shortcut set, and enter in the info for the new shortcut (see above for suggestions)
  5. Repeat previous step until your have created all desired Shortcuts, then repeat process for other roles
  6. Install and enable the Shortcut per Role module.
  7. Go to Administration > Configuration > User interface > Shortcuts per Role
  8. Link the relevant Role to the relevant Shortcut set via the selection menus.
  9. Click Save Configuration

Changing the default number of Shortcut bar links

By default only 7 shortcuts are allowed in the shortcut bar. There are currently two ways to change this; apply this patch or add a line to settings.php

Comments

phponwebsites’s picture

How to add menu item into shortcut menu programmatically?

azovsky’s picture

Add function THEMENAME_preprocess_toolbar(&$vars) in theme template.php and alter $vars['toolbar']['toolbar_drawer'][0]['shortcuts'] or/and $vars['toolbar']['toolbar_menu']['#links'].

wdseelig’s picture

Thank you very much for this.

I had programmatically added an item to the admin menu that I only wanted to be available to some users, but found that all users on my site could see the item that I had added. No amount of fiddling with access permissions, either in my code or in the Permissions on my site, solved the issue.

But modifying the css did the trick.

Still, it seems strange to me that there isn't a way to set access permissions for admin menu items. This is clearly done by Drupal core itself, because none of the "basic" admin menu items [Dashboard, Content, Structure ... etc.] are available to anonymous users. Yet the item that I had added showed up. I was able, as this post suggested, to implement a .css rule that solved the problem, but it seems a little strange that this is the only way I could do this.

Wyckham

Wyckham

acnimda’s picture

Thanks for making such a nice toolbar.
I use Drupal 8.1.9 and I love it. Hope you can help me

I used to use de toolbar for installing modules, edit views ect. I don't know what happened, but installing a mudule or editing views, looks like a sitedisplay right (links below)

I liked the other way so much, how can I change these settings?

With Kindly Regards,

Joehoe

installing a module looks like this

Making a view looks like this