Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

Navigate between Admin Pages using Coffee in Drupal

Parent Feed: 

The Coffee module adds quick search functionality for backend pages in Drupal. The module was inspired by the Spotlight app on MacOs and Alfred.

Coffee makes it possible to navigate quickly through backend configuration pages by just searching for them instead of using the toolbar.

Table of Contents

Getting Started

Before we begin, download Coffee by running the following Composer command:

composer require drupal/coffee

Then go to Extend and install the module.

How to use Coffee

To display the pop-up window, use alt+D (or alt+K) for Windows or opt+D for MacOs.

Start typing the page title, and you should see results returned, then click on one of the returned results and you’ll be redirected to the page.

You can also display the pop-up by clicking on the “Go to” link in the toolbar.

Jump to Create Page using :add

Furthermore, Coffee facilitates opening a new page or article for you, just type “:add” and choose an article or a basic page. You can also go to the front page by typing colon only.

Module Settings

You can configure the module by going to Configuration -> Coffee (/admin/config/user-interface/coffee).

Here you can configure which menus will appear in the results and the max number of items returned. By default, it’ll only show a max of 7 results.

Module Permissions

The module comes with two permissions:

  • Access Coffee: This allows you to use the Coffee functionality.
  • Administer Coffee: This allows you to configure the module.

If you have an editor role and you want them to use Coffee then assign them the “Access Coffee” permission.

Change Keyboard Shortcut

Currently, you can’t change the default shortcut key from Command/Ctrl/Alt-D. There is, however, a patch for the module if you really want to do it.

If you want to define your own commands in the Coffee module using (hook_coffee_command); see coffee.api.php for more documentation.

Alternative to Coffee

The Admin Toolbar module comes with a quick search functionality which is similar to Coffee. You can learn more about this by reading the “Add Quick Search and Drop-downs to the Toolbar using Admin Toolbar in Drupal” tutorial.

Summary

The Coffee module offers handy functionality especially if you spend a lot of time administering Drupal sites.

The ability to quickly jump between pages can speed things up and make you more productive.

Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web