I tried the following code:

$document = JFactory::getDocument();
$renderer   = $document->loadRenderer('modules');
$position   = 'precisions';
$options   = array('style' => 'raw');

echo $renderer->render($position, $options, null);

I can render modules anywhere I tried in php code, but I cannot render nested modules in templates files, as I could in articles… They are printed as raw placeholder, like '{loadposition module}'.

I tried to figure out what happens with the debugger, but seems that, at first, the nested modules is parsed, then, it is wipe out by the parent content.

What should I do to get the same result than Joomla inside articles, but in templates? How can I avoid this wipe out?


Ok, my bad… I forgot to put this code inside mod_xxxxx.php

if ($params->def('prepare_content', 1))
    $module->content = HTMLHelper::_('content.prepare', $module->content, '', 'mod_xxxxx.content');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.