Loading a module in another module in Joomla

I am an absolute beginner using Joomla. I am trying to load a module in another module, but I cannot find how to do it. I tried to add

{loadposition position}

with the "position" replaced the position of the module that I would like to download, but it seems to work only in articles.

I found another solution here: http://forum.joomla.org/viewtopic.php?p=1531754&sid=bae9b487983c7e8a9f9c4fbd2958cf52#p1531754 but I don’t know where to put this PHP code in my module.

Thanks for the help!

+3
source share
2 answers

You need to manually add the code to map your internal module to your container module. Here is an example:

jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('mainmenu');
$attribs['style'] = 'xhtml';
echo JModuleHelper::renderModule( $module, $attribs );

: http://docs.joomla.org/JModuleHelper/renderModule

, , html.

'mainmenu' , . ( , , ).

+12

, ( , )

: ( 2.5 3.0)

, , "oehelp".

$document = &JFactory::getDocument();
$renderer = $document->loadRenderer('modules');
$options = array('style'=>'raw');
echo $renderer->render('oehelp',$options,null);

,

Saludos

+4

Source: https://habr.com/ru/post/1766010/


All Articles