How Modules Work


It could be said that PostNuke is simply a collection of modules, and, for the most part, that is true. If you look through the PostNuke install directory, you see there are more files and content in the one modules folder than all the others combined. Each module performs one or more tasks for the system, and it's PostNuke's component structure that allows you to customize your site to such a high degree. If you don't need a specific module, remove it. If you need additional functionality, add a new module. Modules are what give PostNuke its functionality.

Module files are all found in the /modules/ directory off your site root. You can install a new module by simply copying its files into the module directory. Modules are removed in the same way by deleting them from the folder. But in either case, you must let PostNuke know about your module changes through the main Module Administration screen, detailed later in this chapter.

Configuring Modules

You can configure PostNuke modules in many different ways. When you were making changes to the Website Configuration page in Chapter 3, "PostNuke Essentials," you were updating information in the Settings module. In fact, all of the icons found on the Administration Menu are links to configure their respective modules. There is even a module that controls all PostNuke modules' install and activation levels; it is appropriately called Modules and is also found on the Administration Menu.

Click into the Modules page, and you see a relatively blank page containing just two links: List and Regenerate. Either link choice generates a listing of modules you can manage from this page. List shows all of the modules currently installed and running on your PostNuke site, sorted alphabetically by name. It queries the database only for this information.

Regenerate looks first to the PostNuke file folders and tallies all of the modules it can find that have been loaded onto the server. It then compares that listing with the database entries and produces an updated list of all existing and new modules. If you have not installed any new or removed existing modules since you last generated a list, there will be no difference in the resulting list shown by either link. Using the Regenerate link every time to create a current listing does not harm your site.

Note

When you regenerate the listing, new modules added to your PostNuke /modules/ folder are shown with an Initialize option. You must initialize new modules before they can be activated.


As you can see in Figure 4.1, the modules table has six columns. The meanings and functions of each column are as follows:

Figure 4.1. Managing your installed modules.


  • Module Name This is the real name of the module as it's referenced in the code. There are no spaces in the name, so words can be run together or joined with an underscore. When you need to reference a module name in a site setting, this is the name you need to use.

  • Display Name This is the user-friendly name of a module. In some listings, such as the Main Settings page, the Display Name is used to identify its respective module.

  • Description This column lists a short description for each module to clarify its function.

  • Directory This column allows you to identify different modules when you are doing file management. Modules' physical folder locations on your server are defined here.

  • State This is the current status for a given module. Possible states include Active, Inactive, New Version Installed, and Uninitialized.

  • Actions The links in this column allow you to edit the operation of their respective modules. The first option is coordinated with the state of a module; for example, an active module has the Deactivate link in the Actions column. The last link allows you to edit the modules operation. Modules with an inactive or uninitialized state also have a Remove option. Removed modules are dropped from the PostNuke system at the database level. The source files remain, and the modules can be immediately reinitialized, but all previous data is gone. Selecting Edit allows you to configure how the module interacts with PostNuke. From the Edit page, you can usually rename the module, change its description, and toggle the activation of additional hook features, such as Autolinks, Ratings, or Wiki support.

To see the options in action, deactivate the Polls module and return to your site's Administration Menu. Notice the Polls icon and link are missing. Activate the module again and you see Polls reappear on the Administration Menu. Other modules you install also appear as they are added.

Note

Deactivating the wrong module here can completely take down your site, requiring a reinstall if you are unable to manually make database changes to recover. The Admin, Groups, Permissions, Settings, and User modules are specifically ones you should never disable without accounting for the missing functionality beforehand with replacement modules or hacks.


You might also have noticed that even though the Polls module is deactivated, the poll on the home page remains. That is because the home page poll is an instance of a block, and not the module itself. Some blocks have functionality that can exist even if their module is removed. You learn more about blocks after covering the PostNuke core modules in the following section.



    PostNuke Content Management
    PostNuke Content Management
    ISBN: 0672326868
    EAN: 2147483647
    Year: 2003
    Pages: 207
    Authors: Kevin Hatch

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net