Related to this discussion Do we have "Canonical questions", on DA?.

I took some time out to write this fairly long answer Q/A: How should I implement hook_menu()?

My hope is that the question can achieve two things. It's step by step nature, should be helpful for anyone with a "Why doesn't my hook_menu work?" question, of which there are quite a few. Secondly, it should cover a lot of other basic "How do I do X in hook_menu".

I suggest it be considered for canonization.

As is common on meta-sites, I suggest up votes on this question could be considered "Yes, canonize it", and down votes be considered "No, don't canonize it".

I would love to hear feedback on the style and scope of the question, as I may decide to write more potentially canonical questions if this gets accepted.

1 Answer 1


The only suggestion I would give is to always prefix the function names with the short name of the module. For the rest, the question, and the answer are excellent.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .