Zikula Network
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
Subscribe!
Why I love Zikula (Reason #768)
Today I had a problem: I am working on a theme that is supposed to use AJAX. Now Zikula only offers it's own AJAX solution for modules only. And I asked on the developers' list how I can solve this problem. And I thought I get a low level do it yourself AJAX recommendation. But au contraire...
Themes allow you to override and expant almost everything, modules can do. You can override templates, CSS add plugins and so on. Modules on the other hand can get extended with extra functions. So if you need an additional user API function for "strangersModule" you can add that like this:
/config/functions/strangersModule/pnuserapi/youfunction.php
Within this file you write your function as if it was in:
/modules/strangersModule/pnuserapi.php
The same works for all the files in a module root. So if you need a AJAX function for your customized templates in a module that doesn't yet have a pnajax.php you can add this in the same manner:
/config/functions/strangersModule/pnajax/youfunction.php
This prevents hacks of modules that get lost with the next update.
Now what I learned from Mateo today: You can also add these extra functions also in a theme:
/themes/MYTHEME/functions/strangersModule/pnajax/yourfunction.php
As my function is not a module specific but theme specific function I added it to the Theme module. And as the Theme module is a system module I can rely on it's presence in the system:
/themes/MYTHEME/functions/strangersModule/pnajax/myfunction.php
This proved to me once again that Zikula is all about creativity. Zikula offers so many cool things and sometime I think we haven't yet started to meter its potential.
Share This | Print




