繁体   English   中英

Joomla 模块管理面板中的自定义按钮

[英]custom button in Joomla module admin panel

Joomla 新手(一个月)。

我正在尝试创建一个列出事件(名称和时间)的模块。 我希望从管理面板填充模块。 例如,假设模块列表将在前端列出以下内容:

  1. 早餐............ 9:30
  2. 午餐............12:30
  3. 晚餐…………7:30

在管理面板中,将有输入文本字段供管理员添加/删除事件和一个按钮,该按钮将调用 js function 执行添加/删除。

我正在使用 Joomla4 我的印象是,我需要做的就是在配置部分中告诉清单文件我的按钮,然后在 mod_project.php 文件中写入 javascript,该文件将在按下时添加/删除一个字段。 (Perhaps the js needs to go in the tmpl/default.php I'm not entirely sure where to put it) Unfortunately my attempt to add a button in the config file has failed meaning there is no output in the html: current config section清单文件:

 <fields name="params"> <fieldset name="basic"> <field name="event_name_0" type="text" label="Event Name" filter="event" /> <field name="event_time_0" type="text" label="Event Time" filter="event" /> <button type="submit" id="testBtn" value="Add">Add</button> </fieldset> </fields> </config>

我昨天必须这样做,但我发现了一个更简单的解决方案:我刚刚为我的特定类别添加了一个自定义字段,类型可重复,并且我编写了一个模块来读取这个特定字段。

暂无
暂无

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

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