How to include module in default.php file - Joomla! Forum - community, help and support
hi,
i trying insert user menu in default.php file of mod_login. have overridden module, , tried insert module regular way
but translating html page, in, can see jdoc code in html file, nothing supposed appear.
can not use jdoc:include within view files? how insert module call in file??
any highly appreciated.
cheers,
aditi
i trying insert user menu in default.php file of mod_login. have overridden module, , tried insert module regular way
code: select all
<jdoc:include type="modules" name="usermenu" />but translating html page, in, can see jdoc code in html file, nothing supposed appear.
can not use jdoc:include within view files? how insert module call in file??
any highly appreciated.
cheers,
aditi
ok, after digging around found answer. apparently jdoc:include not work within file. used jmodulehelper:rendermodule() function instead.
this code
the getmodule function important, need menutype [in case mod_menu] , menu title correct. $attrib['style'] module chrome, can checked here
http://docs.joomla.org/what_is_module_chrome%3f
and thats it.
hope helps someone.
this code
code: select all
jimport('joomla.application.module.helper');
$module = jmodulehelper::getmodule('menutype', 'menutitle');
$attrib['style'] = 'xhtml';
echo jmodulehelper:rendermodule($module, $attrib);
the getmodule function important, need menutype [in case mod_menu] , menu title correct. $attrib['style'] module chrome, can checked here
http://docs.joomla.org/what_is_module_chrome%3f
and thats it.
Comments
Post a Comment