PostNuke

Flexible Content Management System

News

Did you know: Module Templates in the Themes Folder

Contributed by on Feb 27, 2007 - 03:46 AM

The formula is: Customization in the theme only!



Step 1: The Postnuke templating engine looks for templates in different places and it always looks first in the theme and then in the module folder. So if it finds the needed template in the theme it stops searching:



/themes/YourTheme/template/modules/ModuleX

is the equivalent for

/modules/ModuleX/pntemplates



Everything that is contained in the module's templates folder can be stored in the same manner in the theme's folder. For example EZComments contains several template-sets in subfolders these can simply be copied into the theme. The same applies of course for the plugins that are stored in the module's templates folder.



Step 2: If you have to write your own plugins, store them in

/themes/YourTheme/plugins/ModuleX

instead of in

/modules/ModuleX/plugins or something



Step 3: If you change a module's style sheet you can place it at

/themes/YourTheme/style/ModuleX



You see: There is a place for everything that can be customized in the theme folder. And the best thing is, that this feature had been in PostNuke ever since version .750. In the end you won't have any customizations inside any other folder but the themes folder - and if you don't overwrite that folder, you will never again lose changes during updates.



Now there is one objection you could make: When you don't update a module's templates you might not benefit from new features - the old templates might also be disfunctional. - Of course this is a problem. But with the above solution you can at least keep your layout and then include the new stuff.



Note: Only for the language files is no such solution available yet. This will be solved in future version though. The redesign of the language system is a .9 topic.







1149