Skip to main content

Easy Drupal Documentation via Custom Chrome Search Queries

Drupal

I spend much of my day working on Drupal websites. I use the barebones text editor, Textmate 2, so I don’t have any in-app Drupal documentation at my disposal. And while I’m beginning to have some parts of the API memorized, I still find myself needing to look up API functions in Drupal’s online API documentation. For a long time, I would search Google for Drupal and the API function. Then I learned this cool trick. Drupal’s API documentation follows a simple URL pattern, which makes creating a custom Chrome search engine possible. Here’s how it’s done. 

  1. Open Chrome’s settings. 
  2. Under search, click Manage search engines… 
  3. You’ll see a list of default and other search engines. Scroll to the bottom of the other search engines. 
  4. In the area to enter a new search engine, add a new one called Drupal API, keyword “druapi”, and URL “http://api.drupal.org/api/search/7/%s”

Now when you place your cursor in the URL bar, type “druapi”, and press tab, you can enter are API function to go directly to its documentation. Chrome is nice enough to keep a history of functions you’ve looked up as well. This works for Drupal module search (http://drupal.org/project/modules?solrsort=sis_project_release_usage%20desc&text=%s) and module pages (http://drupal.org/project/%s) as well.