Chapter 6. Module Template Override

You may wonder how a basic XOOPS theme can be so small in size. It’s because XOOPS themes only set the overall styles and block layout. But XOOPS-powered websites are more than that, because they are equipped with many modules. Modules are a special feature of XOOPS, which makes it highly extendable. Modules work like plug-ins to some extent, but they are far more powerful. Actually, the XOOPS core system can be viewed as a basic module.

Then there is a problem: how do you deal with the themes for different modules? XOOPS themes only set the basic styling and block layout, and allow specific modules to have their own templates—even styling—provided that the stylesheets will not clash.

Since we are now on the topic, I should pause to explain the difference between a theme and a template.

A theme in XOOPS sets the style of an entire XOOPS website. The stylesheet will be applied to the whole website, including all the modules. The theme also sets block layout.

A template in XOOPS sets the layout of a specific part of XOOPS. The specific part can be block content, a module page, or a forward page.

Here are some further insights into themes and templates in XOOPS:

  • A theme sets the layout of blocks; a template sets the layout in each of the blocks.

  • A theme sets the style of a module page; a template sets the layout of the module page.

  • A theme can be seen as a template of XOOPS blocks.

  • A theme resides in /XOOPS/theme, while a template resides in modules/MODULE_NAME/templates/ ...

Get Designing for XOOPS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.