DrupalCon SF: Implementing Drupal 7 Usability Improvements in Your Custom Modules

Session Notes: D7UX: How to integrate the core Drupal 7 usability improvements with your module

There has been a big effort in Drupal 7 to improve usability. This talk discussed how to implement these features in your custom Drupal 7 modules. (Or on contrib modules you might be helping with.)

  • New IA (Information Architecture)
  • Shortcuts bar
  • Overlay
  • Admin theme
  • Local actions
  • Modules page (Help | Permissions | Configures -- for each module)

The usability improvements that will be included in Drupal 7 are only part of what has been designed in the larger D7UX effort.  More will be implemented in Drupal 8.

Very rough coding notes:

Contextual links

in hook_menu() add:

'context' => menu_context_page | menu_context_inline

Contextual links are helpful, supplemental. But they should not be relied upon exclusively. They should still be accessible in the regular admin menu system.

Dashboard

Any normal block is automatically available for use in the dashboard.

Local Actions

in hook_menu() add:

'type' => menu_local_action

These are different from tabs. Tabs are things that you look at, see. Typically lists of things or current configurations.  Local Actions are something you *do* such as ADD content.

Overlay (and admin)

Why: because people often lose context when doing an admin task. With the overlay module, when you are through with your admin task, you are returned to where you were before you started.

You tell a link to open in the overlay by specifying that it is an "admin" link. Implement hook_admin_paths()

signup_admin_paths() {
$paths = array (
'node/*/signup => TRUE
)
return $paths;
}

To alter admin paths set by other modules, use hook_admin_paths_alter()

Vertical Tabs

In form definition

'#group' => 'additional_settings'

Additional Resources

http://drupal.org/ui-standards

Posted in:

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.