I created a custom mod_helloworld module, according to the instructions in the Joomla 3 documentation. I have a "lang" parameter on the mod_helloworld.xml config section.
The module is loaded inside an article using {loadmodule mod_helloworld, "mytestmodule"}
In the mod_helloworld.php I can't get the "lang" parameter value out using
$language = $params->get('lang')
.
Also var_dump($params) and var_dump($module) give pretty empty results.
I have managed to get the results using:
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule( 'mod_helloworld', 'mytestmodule' );
$params = new JRegistry($module->params);
But, I don't think this should be necessary inside the "current" module.
Also tried this by duplicating an existing standard joomla module and changing its name. Same effect, although the original works fine.
If I load the module somewhere else on a page, like in some template position, it works fine, but not when loaded inside an article. Yet the existing "standard" joomla modules work fine also when loaded inside an article.
What's wrong here?