Cheat sheets are a compressed list of useful commands, functions,
overall helping tips in order to help accomplishing a certain task. This GHOP task
would be to create such a cheat sheet for Drupal 6 core hooks. Using this cheat sheet
these basic hooks should be accessable without the need to look them up in the handbook.
An initial suggestion on what should be included on this sheet:
The Drupal hooks cheat sheet should contain the following references for each hook:
- A function prototype for each hook defined in core.
- A brief description of each hook defined in core.
- A reference to where you may find a the hook implemented in core.
The deliverable will be a downloadable pdf or png in US letter size, with at most two
sides, so it can be printed on one piece of paper.
Use a design that can display much information, for example similar to those below on
ilovejackdaniels.com, but feel free to come up with your own approach as long you
provide the required information.
Resources:
* Useful examples on cheat sheets: http://www.ilovejackdaniels.com/cheat-sheets/
* For information on function prototypes: http://en.wikipedia.org/wiki/Function_prototype
Primary contact:
* Brad "beeradb" Bowman
The associated google issue can be found here - http://code.google.com/p/google-highly-open-participation-drupal/issues/...
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | drupal_core_hooks_cheat_sheet_v5.pdf | 117.16 KB | kourge |
| #7 | drupal_core_hooks_cheat_sheet_v4.pdf | 116.68 KB | kourge |
| #6 | drupal_core_hooks_cheat_sheet_v3.pdf | 115.17 KB | kourge |
| #5 | drupal_core_hooks_cheat_sheet_v2.pdf | 102.06 KB | kourge |
| #1 | drupal_core_hooks_cheat_sheet.pdf | 80.15 KB | kourge |
Comments
Comment #1
kourge commentedInitial upload.
Comment #2
aclight commentedThis looks really good.
I'm leaving the status as CNR in the hopes that others will review this, but actually it needs a little work, IMO:
1.) I'd add a copyright in the footer with the licensing terms (ie. CC 2.0, as on the footer of the handbook pages on d.o).
2.) I'd like to see the date and the Drupal version for which this sheet is valid, probably just under the Drupal logo. That way, once D7 is out, I won't get my cheat sheets confused :). Having the date will also be useful if there are any API changes that get in due to bug fixes, etc.
3.) Because I have a color printer I was hoping there would be a little more color involved here. However, I'm not sure how it could be utilized in a useful manner.
4.) IMO, the variables in the function prototypes are a bit hard to distinguish from the function names, since they are in the same font and color. When scanning down the page, it might be nice if the function names were a little more distinguished from the rest of the line. Maybe you could put the names of the functions in bold?
5.) I assume that for functions with a N/A in the "In Core" column, that means that those functions are not implemented in core. Would it make sense to refer the reader to the module where the hook itself is defined? Maybe not, but just thinking out loud.
6.) For some of the hooks, the example you give might not be the best example. How did you select the module to use there when more than one module implements said hook?
For example, for hook_filter() and hook_filter_tips(), I probably would have listed filter.module instead of php.module. You might to try to give the module that implements the hook in the most "typical" way, or one that implements in a more complicated way, or something. Just an idea.
Overall, I think this is very nice. A few fairly quick fixed should finish this off, IMO.
Comment #3
dmitrig01 commentedI'll give it my review
Comment #4
aclight commentedThe left col is for finding them quickly by the letter the hook starts with. I like the column personally.
Comment #5
kourge commented@aclight
1 & 2) Done
3) Refer to dmitrig01's point 3).
4) Function names are now bolded.
5) From my personal experience, looking at the module that invokes the hook is the second thing that I'd do when I want to know more about the hook. The first thing I'd do is to look up the example implementation on a.d.o.
6) For each hook, I went through all core modules that implement that hook. Then I pick the one that I think implements the most of the aspects of that hook. Sometimes I pick the one that I think is the easiest to understand. You're right about hook_filter and hook_filter_tips, because since filter.module provides more filters than php.module, it's actually a better example.
@dmitrig01
1) Now it's renamed "Implementation In Core." "Example Implementation In Core" would be better, but there's not enough space.
2) Referring to aclight's comment, this is for quicker scanning for the reader. Initially all the hook descriptions were aligned right to make the visual scanning even more streamlined, but beeradb thought that the layout was quirky. The alternative was to indent every description a bit; beeradb and I both thought that it wouldn't help much, since "hook_" is already five characters, so the best compromise is to add a letter index.
3) The table is now themed with a shiny Garlandish blue.
Version 2 attached.
Comment #6
kourge commentedNow replacing Monaco with Lucida Sans Typewriter, a font that actually supports bold type (instead of letting Word do a faux bold).
Comment #7
kourge commentedAnother revision with a minor set of improvements.
Comment #8
keith.smith commentedhook_watchdog and hook_mail_alter need periods at the ends of the function descriptions.
Comment #9
kourge commentedMore improvements. Hopefully this'll be the final version.
Comment #10
beeradb commentedthis looks really good to me. I'm gonna rtbc it.
Thanks kourge.
Comment #11
aclight commentedGreat job. I created a handbook page for core cheat sheets at http://drupal.org/node/212648 and attached this file there.
Comment #12
kourge commentedYay!
Comment #13
aclight commentedI don't think you meant to change the status.
Comment #14
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.