joomla3.0 - 如何将子表单的 (Joomla) 管理布局从表格模式更改为 div 模式?

标签 joomla3.0

我需要将 Joomla 3.9.13(后端)中子表单的管理 TableView 更改为(已经存在的)div 模式。 我可以通过更改以下代码来做到这一点:

plugins/fields/repeatable/repeatable.php 第 52 行

改变:

$fieldNode->setAttribute('layout', 'joomla.form.field.subform.repeatable-table');

致:

$fieldNode->setAttribute('layout', 'joomla.form.field.subform.repeatable');

这是一个核心修改。那么如何在不修改核心文件的情况下实现这一目标呢?

最佳答案

子表单字段类型有一个默认功能,允许您选择布局。

layout (optional) the name of the layout to use when displaying subform fields. Available layouts:

joomla.form.field.subform.default render the subform in a div container, without support of repeating. Default for single mode.

joomla.form.field.subform.repeatable render the subform in a div container, used for multiple mode. Support groupByFieldset.

joomla.form.field.subform.repeatable-table render the subform as a table, used for multiple mode. Supports groupByFieldset. By default each field is rendered as a table column, but if groupByFieldset=true then each fieldset is rendered as a table column.

您需要在表单 xml 文件中更新此文件,该文件位于/models/forms/viewname.xml

<field
    name="field-name"
    type="subform"
    label="Subform Field"
    layout="joomla.form.field.subform.repeatable"
/>

https://docs.joomla.org/Subform_form_field_type

关于joomla3.0 - 如何将子表单的 (Joomla) 管理布局从表格模式更改为 div 模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58803418/

相关文章:

mysql - Joomla JAuthentication : :authenticate error

php - $params->在方括号之间设置数组

mysql - Joomla 数据库 - 如何在 getQuery 中使用 LIMIT?

components - JForm::getInstance 无法加载文件

html - 在页面上居中 div

javascript - Joomla 不保存字段类型编辑器值

与 Joomla 菜单类型关联的 CSS 样式未定位

joomla3.0 - joomla 注册表和多个组

php - 无法在本地主机上安装 joomla

php - 如何从外部php文件连接joomla3 DB?