feel free to keep it strictly simple...

page headers

Initial situation

LEPTON inherited the register_frontend_modfiles() thingy that was introduced in Website Baker as a temporary solution, but never replaced then. Template developers had to add several calls to their templates to make sure that all required files are added 'automatically'.


   if(function_exists('register_frontend_modfiles')) {

This would include frontend.css and frontend.js of any module used on a page (or any module of type 'snippet'), and jquery.min.js from the WB includes folder. There's no way to add any different named files, or load header files conditionally (based on PAGE_ID, for example).

The LEPTON way

There is only ONE method to be called in the

section of a page template:

You can use this for both Frontend templates and Backend themes.

The function is downward compatible and automatically loads the following files of all modules used on a page (if exist):

  • /frontend.css (media: all)
  • /css/frontend.css (media: all)
  • /frontend_print.css (media: print)
  • /css/frontend_print.css (media: print)
  • /.css (media: all)
  • /css/.css (media: all)
  • /_print.css (media: print)
  • /css/_print.css (media: print)
  • /frontend.js
  • /js/frontend.js

Of course, there is an equivalent for register_frontend_modfiles_body(), too:


Just include this call right before the closing to automagically load:

  • /frontend_body.js

Modules may define additional files to be loaded automatically. A template designer don't have to know about this. Anyway, if you're interested in details, see the developer docs.


Just add


to the


right before and you'll never have to think about this again!