简体   繁体   English

Joomla,显示未分配给任何位置的模块

[英]Joomla, Display a module that are not assigned to any position

I'm new to Joomla and i need to show a module (joomla 3.x) that is not assigned to any positions. 我是Joomla的新手,我需要显示未分配给任何位置的模块(joomla 3.x)。

jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules('find_a_story');
foreach( $modules As $mod ){
echo  $mod->content;
}

I figured out the above code to display modules from a position, But how will i display a module that is not assigned to any Position but published ? 我想出了上面的代码来从职位显示模块,但是我将如何显示未分配给任何职位但已发布的模块?

Please check JModuleHelper/getModule helper class documentation. 请检查JModuleHelper / getModule帮助器类文档。

Using example 2 you could get the module you need based on type and name: 使用示例2,您可以根据类型和名称获得所需的模块:

  jimport( 'joomla.application.module.helper' );
  $module = JModuleHelper::getModule( 'mainmenu', 'Resources' );
  echo '<pre>';
  print_r( $module );
  echo '</pre>';

Good Luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM