2014-10-27 34 views
1

安装时是否可以发布模块?在Joomla中安装组件时设置为发布状态

我正在安装一个模块以及组件。我需要在安装组件时将模块的状态设置为发布。

我使用manifest.xml文件下面的代码:

<modules> 
    <module module="mod_custom" publish="true"/> 

    // I also tried none of them work 
    <module module="mod_custom" client="administrator" publish="true" /> 
</modules> 

任何建议,请。

+0

你为什么要自动发布该模块。 即使模块已发布,您将不得不浪费精力为网页上显示的位置设置一些参数 – Umair 2014-10-27 08:02:40

回答

0

在组件的install.php了,你可以看看在#__extensions表安装模块的ID,然后将其添加到模块表和发布,但...

  1. 考虑小心如果你超出了你的责任。您是否100%确定全部安装组件/模块的用户将想要立即发布该模块?
  2. 您将模块发布到哪个模块位置?有没有保证使用任何特定的模块使用的模板定位

您可以了解更多关于安装php文件位置:http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_an_install-uninstall-update_script_file

相关问题