For block, use main templates instead of block's template.
$tpl =& new XoopsTpl() ; $tpl->assign( 'block' , $block ) ; $ret['content'] = $tpl->fetch( 'db:'.$mydirname.'_block_(template_name).html' ) ; return $ret ;