[development] override theme of another module

Roman Chyla roman.chyla at gmail.com
Sat Sep 29 10:08:04 UTC 2007


Thank you Nevets for your reply,
I know it would be possible to use templating and in the module the
theme() calls are used, nevertheless,

(1) the ejournal module can operate several "publications" and each of
them may require its own specific themeing - ie. one module, one site,
several journals with different look
(2) imo, it is not so friendly

  roman
>
>         Normally if one has a module, lets call it mymodule
>         then one would provide theming functions along the lines of
>
> function theme_module_page(...) {
> }
>
> function theme_module_paragraph(...) {
> }
>
>         Then when calling these functions one would use
>
>         theme('module_page', ...);
>         and
>         theme('module_paragraph', ...);
>
>         The theme function is the key here, it not only provides
>         the override mechanism but also only makes a function call
>         if it finds an valid theme function.  So there is no need
>         for the caller to do any checking.
>
>         Then in using phptemplates one can override with either
>
> function phptemplate_module_page(...) {
> }
>
> or
>
> function themename_module_page(...) {
> }


More information about the development mailing list