Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- craigh responded to »Using PageUtil::addVar() to load script code« 03:29 PM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Wiki » ModuleDevGuidelines
Additions
In order to improve the overall quality of Zikula modules we would like to give some guidelines for module devs which (hopefully) make everyone's life easier - both the devs and of course the users too (with users being the site admin and the final website users).
Make sure that your modules zip or tar.gz can be extracted directly into the Zikula root folder. This means the top level folder should by modules/, not html/modules and also not the modulename itself.
This kind of onload handler takes care of several onloads per page, internally an array of onload functions is used which are called one by one. The normal use of window.onload replaces an existing handler with a new one which means that only the last one added will be executed. This might break some sites that make heavy use of JavaScript? in several parts of the display.
Deletions
In order to improve the overall quality of Zikula modules we would like to give some guidelines for module devs which (hopefully) make everyones life easier - both the devs and of course the users too (with users being the site admin and the final website users).
Make sure that your modules zip or tar.gz can be extracted directly into Zikula root folder. This means the top level folder should by modules/, not html/modules and also not the modulename itself.
This kind of onload handler takes care of several onloads per page, internally an array of onload functions is used which are called one by one. The normal use of window.onload replaces an existing handler with a new one which means that only the last one added will be executed. This might break some sites that make heavy use of javascript in several parts of the display.
Guidelines for module developers
In order to improve the overall quality of Zikula modules we would like to give some guidelines for module devs which (hopefully) make everyones life easier - both the devs and of course the users too (with users being the site admin and the final website users).
This should become a collection of useful hints and code snippets, tipps and tricks, possible pitfalls and how to avoid them.
General guidelines
Naming
Please, please please: Avoid using the pn-Prefix for module names. We already have enough pn* modules which blow up the alpha list for P in the modules list.
Packaging the module
Correct packaging is important for automatic release builds using EasyDist?, a simple interface to create any preconfigured package, ehich is currently under development.
Make sure that your modules zip or tar.gz can be extracted directly into Zikula root folder. This means the top level folder should by modules/, not html/modules and also not the modulename itself.
Module
Templates
Naming scheme
Use a naming scheme like {modulename}_{type}_{function}.html, eg. permissions_admin_view.html or memberslist_user_recent.html. Its obvious where these templates belong to.
Plugins
Javascript
When using javascript try to make use of prototype.js where ever possible.
Example: Instead of
var obj = document.getElementById('mydiv');
window,onload(function() { init_the_system(); });
window,onload(function() { init_the_system(); });
better use
var obj = $('mydiv');
Event.observe(window, 'load', function() { init_the_system(); }, false);
Event.observe(window, 'load', function() { init_the_system(); }, false);
This kind of onload handler takes care of several onloads per page, internally an array of onload functions is used which are called one by one. The normal use of window.onload replaces an existing handler with a new one which means that only the last one added will be executed. This might break some sites that make heavy use of javascript in several parts of the display.
