Shortcuts to api.drupal.org using Firefox keywords with string replacement
I found out about a handy new Firefox tip today while watching a Drupalize.me video, which I thought I would share.
As you may or may not know, you can assign a keyword to a bookmark. When you type in that keyword into the Firefox URL bar, you will be sent off to the full URL. So it saves a bit of typing.
The real time saving begins when you start doing string substitutions. You can add a sting after the keyword, and this will be added to the end of the URL. For example, I can type in dapi hook_block_save into the URL bar, and I will end up on api.drupal.org on the page for hook_block_save (D7). Lets go through how to set this up.
Shortcut to api.drupal.org hook function pages
Go to http://api.drupal.org/apis and add it as a bookmark.
Go to Show all bookmarks and find that bookmark. The URL will probably be http://api.drupal.org/api/search/7/apis as you would be been redirected, so remove api/search/7/ from the URL.
On the end of the URL, add %s, so it will become http://api.drupal.org/apis/%s. Under Keyword, add dapi.
Now, in your URL bar, type dapi hook_block_save. This will append the url with hook_block_save and send you to http://api.drupal.org/apis/hook_block_save. http://api.drupal.org/apis is a special page which will redirect you to the hooks page of the latest Drupal version (in this case Drupal 7) if you add the hook name to the path. If that hook does not exist in the latest Drupal version, it will do a search for it instead.
Type dapi hook_block_save
You'll be sent to http://api.drupal.org/apis/hook_block_save, which redirects to http://api.drupal.org/api/drupal/modules--block--block.api.php/function/hook_block_save/7
Hopefully that will save you a bit of time. Every little bit helps!
If you liked this, you'll love my book, Master Drupal Module Development.
"..the must have drupal developers book"
Feeling stuck with Drupal 8 module dev?
Get the free 7 lesson course that will help you get started today without feeling overwhelmed.
- Create Drupal modules with just a few commands using the Drupal Console
- Create custom pages
- Create custom blocks
- Create admin forms
- Demystify routers and controllers
- Bonus material