ModulesModules are a deployment packages of certain functionality. E.g. Pages, Blog, News, User Management … Rabbit Module is extremely simple and light weight. It is a static class that has methods with the Hook attribute. It is much simpler than many other frameworks.
public static class ModuleName
{
[Hook("get-module-admin-menu")]
public static dynamic GetAdminMenu(dynamic data)
{
//reacts to the hook
}
}
Hooks are call backs to events. The sample module code above can be explained as the module tells the Rabbit site engine that when event get-module-admin-menu happened, run this.
The Hook attribute by default takes method name as hook name. You can override the name explicitly in the attribute.
The convention is to save the module classes in folder: App_Code\Rabbit\Modules\<ModuleName>\<ModuleName>.cs.
Rabbit framework will scan the child folders under App_Code\Rabbit\Modules. When found modules, they can be enable and disable at runtime using the Rabbit-Admin page.

The Rabbit-Admin page is a UI to configure Rabbit Framework. It is extensible if you will. But out-of-box page is simple yet straight forward. All modules are listed as a line in the text box. To disable a module, comment it out by adding a # in front of it.

When the module is disabled, its admin menus will not be shown on the Rabbit Admin page. Its hooks will not run.
The order of the modules are listed is important. It decides the order that modules to be loaded. Hooks in later modules will run later than earlier modules. This allows the later modules adding more functions on top of earlier modules. It can also be describe differently as earlier modules publish extension points. Later modules implement the extension points. Later modules are the plug-ins to earlier modules.
Using the Rabbit Admin Page, you can turn on the logging to see how the modules being loaded and hooks being added.
3/5/2011 5:56:14 PM SiteEngine: Start Loading Module Core
3/5/2011 5:56:14 PM SiteEngine: AddHook get
sitesettings
3/5/2011 5:56:14 PM SiteEngine: AddHook get_layout
3/5/2011 5:56:14 PM SiteEngine: AddHook get_templates
3/5/2011 5:56:14 PM SiteEngine: Done Loading Module Core
3/5/2011 5:56:14 PM SiteEngine: Start Loading Module Pages
3/5/2011 5:56:14 PM SiteEngine: AddHook get_homepage
3/5/2011 5:56:14 PM SiteEngine: AddHook get_menu
3/5/2011 5:56:14 PM SiteEngine: AddHook save_menu
3/5/2011 5:56:14 PM SiteEngine: AddHook get
moduleadmin_menu
3/5/2011 5:56:14 PM SiteEngine: AddHook get
pagespage_list
3/5/2011 5:56:14 PM SiteEngine: AddHook get
pagespage
3/5/2011 5:56:14 PM SiteEngine: AddHook save
pagespage
3/5/2011 5:56:14 PM SiteEngine: AddHook delete
pagespage
3/5/2011 5:56:14 PM SiteEngine: Done Loading Module Pages
Rabbit Modules are distributed as NuGet Package. NuGet can help managing the versions and dependencies between modules.