9
Here's the deal (as I see it)...
2.0 & 2.2 both share this issue...
In the calling PHP page, if you assign:
Quote:
$myTemplate->assign('xoops_module_header', $xoops_module_header);
to the template (I assign the value in my module specific header), that value will be passed to the .html template without you needing to do anything. The value will appear in the head section of the generated .html file.
That part is great. Straight forward and simple.
Now the icky part.
Cache....
If you enable module wide cache, the information which was being passed via $xoops_module_header no longer gets passed (automagically).
By including:
Quote:
in the html template, the value will be passed, but WILL NOT appear in the header.
In 2.2 a custom smarty post-filter (example below) can be used to write to the head, but this will not work under 2.0.
function (above call to XOOPS header.php)
function add_header($tpl_source, &$myTemplate)
{
return "echo $xoops_module_header; ?>n".$tpl_source;
}
$xoopsTpl->register_postfilter('add_header');
Hope that helps.