简体   繁体   English

在简单的Joomla模块中添加项目按钮

[英]ADD ITEM button in a simple Joomla Module

I am creating a simple and FREE joomla module that will slide items added by a user. 我正在创建一个简单且免费的joomla模块,该模块将滑动用户添加的项目。 I dont know how to create a "ADD ITEM" button in the module that will repeat the field in the admin screen of the module to allow the next entry. 我不知道如何在模块中创建“添加项目”按钮,该按钮将重复该模块的管理屏幕中的字段,以允许下一次输入。

Example - Below is how my module backend will look 示例-以下是我的模块后端的外观

截图

My Module has a field group 我的模块有一个字段组

<fieldset name="sliders" description="To add an item,Click Add New" label="Item - ADD/EDIT Here">
    <field type="sliders" name="sliders" />
</fieldset>

Then I have a fields folder in the module with a sliders.php 然后我在一个带有slides.php的模块中有一个fields文件夹

Not sure where to go from here. 不知道从这里去哪里。

For this you would need to make a new form field which will not be easy. 为此,您将需要创建一个新表单域,这并不容易。

a simpler (built in) solution would be to use jform repeatable. 一个更简单的(内置)解决方案将是使用jform可重复的。

https://docs.joomla.org/Repeatable_form_field_type https://docs.joomla.org/Repeatable_form_field_type

ok, So Joomla 3 has its own repeatable field option. 好的,因此Joomla 3有其自己的可重复字段选项。 Just used the code below and worked. 只需使用下面的代码即可工作。

<field name="list_templates"
type="Repeatable"

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

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