[opencms-dev] How to structure modules

Christian Steinert christian_steinert at web.de
Wed Jul 8 11:50:59 CEST 2009

Marc.Schlegel wrote:
> Thanks, for supporting the idea of splitting it up.
> Now I still have another question. The content-module would specify some 
> details-pages when displaying the content. What I would like to do in my 
> template-module is to present the most recent news in the templatearea 
> (not in the content area). How would that work when the actual 
> contenttype is in another module? And would the template-module then not 
> be dependent on the content-module (for instance, in templateone it was 
> the other way aroun)? Or is the dependecy just for checking that certain 
> modules are available on install?
Jonathan already wrote a long answer - just to raise the IMO most 
important point:
Any module is allowed to access any files in the File System. But since 
your template-module depends on the content-type-module, your 
template-module should explicitly have this dependency set in its 
property. In this way, you enforce, that the required module with all of 
its files and setings is available and then you also don't get into 
practical trouble, if your temploate-module can only function when the 
other one is imported.

Opencms will enforce module dependencies upon import, i.e. you can only 
import a module when all its dependencies were imported before.

Best Regards

More information about the opencms-dev mailing list