How to create a module

Ajato consider two types of plugins: Modules and Themes. It permits users to expand the core functionalities.

Creating a new module is easier than you might expect. you will need:

  1. Create the .info file: The info file holds the basic information about your modules in using XML. Its the solution found to get information without loading potencially harmful Lua code.
  2. Create the hook_menu(): the menu hook will create a list of pages that your module will control. you can define your module show the product form creation on "product/add/" page, for example.
  3. Create each function pointed on hook_menu(): the menu hook have the name of the functions that will be executed when a certain page path. Now is time to generate the HTML that will be printed on the center of your page, as the main content.
  4. Create form if needed: unlike normal pages, you can create forms to get some data form users. You can use forms to add comments on pages, to setup your module and much more. Since forms can be very complex, like a wizard, Ajato offers a Form API, which will make possible to create any kind of forms.
  5. Use the hooks to modify the standard behaviour: your module may not only do original stuff, but also modify the standard behaviour of other modules. You can implemment a "filter" the page contents to convert any Wikipedia-style codes into HTML, add a CAPTCHA on registration form, add pictures on every user page and so on