简体   繁体   English

Joomla! 定制模块

[英]Joomla! Custom Modules

I'm very new to Joomla! 我是Joomla的新手! and I'm building a custom module. 并且我正在构建一个自定义模块。 I've looked at the documentation and although there is a tutorial for creating custom modules: 我查看了文档,尽管有一个用于创建自定义模块的教程:

https://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module https://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module

...there's no instruction for how to actually use these files, or where to put them, or how to properly install them! ...没有关于如何实际使用这些文件,如何放置它们或如何正确安装它们的说明! I've created all 4 files (3 .php, 1 .xml) and I tried putting them in the same folder structure and location as the other "stock" modules (administrator / modules / mod_helloworld etc.) but the module doesn't show up as an option when creating a new module in the back end. 我已经创建了所有4个文件(3 .php,1 .xml),并尝试将它们放置在与其他“库存”模块(管理员/模块/ mod_helloworld等)相同的文件夹结构和位置中,但是该模块没有在后端创建新模块时作为选项显示。 I also tried zipping the group of files and installing through extension manager and that didn't work either. 我还尝试过压缩文件组并通过扩展管理器进行安装,但这也不起作用。

Perhaps I'm coming at this all wrong? 也许我完全错了吗? This just seems to be something that is assumed knowledge in the Joomla documentation tutorial. 这似乎只是Joomla文档教程中假定的知识。 Are there other files that need to be created? 是否还需要创建其他文件? Or edits need to be made to existing files? 还是需要对现有文件进行编辑?

I'm using Joomla! 我正在使用Joomla! 3.4.1 and am working on it from a server. 3.4.1,并且正在通过服务器进行处理。 I apologize in advance for what seems like a very stupid question. 对于这个看起来很愚蠢的问题,我预先表示歉意。

Once you have created your test module files you can put them in a folder that will have the same name as the one you used for your module in the XML file. 创建测试模块文件后,可以将它们放在一个文件夹中,该文件夹的名称与XML文件中用于模块的名称相同
The Joomla naming convention is to start with mod_ for modules. Joomla命名约定以模块的mod_开头。
Let's say the module name is mod_myfirst_module in the XML file 假设模块名称在XML文件中为mod_myfirst_module

<name>mod_myfirst_module</name>

The install folder must use the same name. 安装文件夹必须使用相同的名称。
To install it you have two options: 要安装它,您有两个选择:

  1. For testing you can upload the files directly to the modules folder of your Joomla site (frontend modules go into modules folder, backend modules go into administrator/modules folder) and use the Discover functionality in the Extension Manager of Joomla administation backend. 为了进行测试,您可以将文件直接上传到Joomla站点的modules文件夹(前端模块进入modules文件夹,后端模块进入administrator / modules文件夹),并使用Joomla管理后端的扩展管理器中的Discover功能。
    Menu Extensions->Extension Manager-> Discover on the left column. 菜单扩展->扩展管理器->发现在左列。
    Click on the button Discover and your module will show in the list if you have properly set the files. 单击发现按钮,如果正确设置了文件,模块将显示在列表中。
  2. You can create an installer package. 您可以创建一个安装程序包。 Zip the folder you previously created with the module files, go to Joomla administation backend. 压缩以前使用模块文件创建的文件夹,然后转到Joomla管理后端。
    Menu Extensions->Extension Manager->Install on the left column 菜单扩展->扩展管理器->安装在左列
    Click on Upload Package file tab and select the Zip archive you created. 单击上载包文件选项卡,然后选择您创建的Zip存档。 If the archive contains all the files needed, the module will be installed. 如果归档文件包含所需的所有文件,则将安装该模块。

Delete mod_helloworld from administrator/modules and then .zip this and instal using Extensions>Instalator in Joomla admin panel. 从管理员/模块中删除mod_helloworld,然后使用Joomla管理面板中的Extensions> Instalator将其压缩并安装。

If it will not work, paste the error here. 如果不起作用,请在此处粘贴错误。

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

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