Module Generator
gracenalec - August 25, 2008 - 18:46
Hi all,
I'm new to this whole cms thingy. I plan to create my own module. Is it possible to attach it to drupal and is there such this as a Module generator which allow u to paste your custom php codes inside and publish it as module automatically?
Please advice. Thank you!

Module serve different
Module serve different purposes and therefor implement different Drupal hooks. Drupal hooks are how core "communicates" with your module. The point being your code needs to be written using Drupal API's and implementing some set of hooks for it to work as a module. Now if you are new to this whole cms thingy you might want to consider there are a number of modules that make it possible to put together a site without writing and modules (or even code).
Nope nice idea though
There is no module generator AFAIK, but if you are writing code, the actual setup of a skeleton module is done for you. Depending on the module type (node, block, etc) there are various examples provided on http://api.drupal.org. The module developer's guide will help you get started: http://drupal.org/node/508
If you are "new to this whole cms thingy" how new are you to coding php? It's not a trivial task to get a fully functioning module going. There are many hooks you should support in order to integrate into the drupal core.
Probably the best thing to do FIRST is to look through the downloads for modules that already do what you want. Also, too often people start making a new custom module whereas it would be much more helpful to add on to another module or use part of an existing module's api.
thank you for all the
thank you for all the replies. Does that mean that all drupal modules are actually APIs?
I'm pretty much new to php as well :(
Drupal uses hooks when you
Drupal uses hooks when you want to add to an existing functionality. For example if your module want to add one or more menu entries it would implement hook_menu(). So hooks are a way for core (and some contributed modules) to give modules a change to act on something be it adding menu entries, creating a content type and more. See the hooks sections of the API documentation for more details.
Drupal core (and again some contributed modules) also provide APIs when you want tell/ask core (contributed module) about something. The are a number of API functions dealing with taxonomies, setting messages and more.
So modules implement hooks (you need a least one generally) and call API functions.
Drupal Module Generator
I actually was tired of writing the same code everytime I wanted to start a module. I wrote a quick app (running live off my site and available for download) that generates a skeleton module for you. All you need to do is fill out a form and it will take care of the rest to get you started. I hope you get to check it out and if you think its worth while then by all means submit some feedback on it.
http://www.dueyesterday.net/node/26
http://modgen.dueyesterday.net
dueyesterday.net - Documentation for the masses
=-=
http://drupal.org/project/module_builder may be worth looking at ?