Custom Modules
This page explains custom modules.
|
Custom Modules
|
Custom Modules
A custom module is a module defined by an XSL template that provides some custom functionality.
A custom module package, or ModPack, is a set of custom modules defined in an XML file.
Custom modules can help eliminate a lot of duplicate code and provide some dynamic content.
For example, you may want a custom module that implements the behavior of a navigation bar.
Or maybe a custom module to create indexed sections of a page (like most of the pages in this referrence).
What makes custom modules so powerfull is that you can pass parameters to them, like calling funtions.
Parameters can be passed in the form of attributes on the element or as sub elements.
Here's what the custom module looks like for this section of the page.
<indexedItem id="overview">
<heading>Custom Modules</heading>
<body>...</body>
</indexedItem>
Using the indexedItem module allows me to make all sections have the same layout.
If I want to change how a section looks all I need to do is go change the code in the custom module, recompile, and all the pages are changed.
That's a lot easier than going through and making the change on every page.
You don't need to know XSL to use ModPro.
But you do need to have a good understanding of it if you plan to write custom modules.
If you don't want to write your own custom modules you may be able to find ModPacks that suit your needs or have someone create one for you.
In the future you will be able to download ModPacks from the website.
A good ModPack that comes with ModPro is called ModPages.
It defines modules to help layout web pages.
All of the pages in the ModPro reference where written using ModPages.
A ModPages reference will be available in the future.
|