2014-10-27 63 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