Don’t forget to subscribe to our YouTube channel to stay up-to-date.
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.
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.
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.
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 (
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.
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.