6
Template overloading (or overriding) is done automatically by the core. The module has nothing to do for it, nor has it control. It simply loads the template:
include_once '../../mainfile.php';
$xoopsOption['template_main'] = 'news_archive.html';
include_once XOOPS_ROOT_PATH.'/header.php';
which was enlisted before in xoops_version.php
$modversion['templates'][1]['file'] = 'news_archive.html';
$modversion['templates'][1]['description'] = 'Archive listing';
The basic templates are stored in the module subdirectory templates.
Items are added to the template:
$xoopsTpl->assign('show_articles', true);
$xoopsTpl->assign('lang_articles', _NW_ARTICLES);
$xoopsTpl->assign('currentmonth', $months_arr[$frommonth]);
To have a themed overload, just provide the file in the theme:
themename/modules/modulename/templatename.htm