heimrichhannot / contao-formhybrid_list
包含一个通用的列表和读取模块。这些模块可以显示和处理所有包含过滤、分页、模态处理等的contao实体。
5.11.0
2023-02-21 09:24 UTC
Requires
- php: ^7.1 || ^8.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ^4.4
- heimrichhannot-contao-components/imagesloaded: 4.1.*
- heimrichhannot-contao-components/jscroll: 2.3.*
- heimrichhannot-contao-components/masonry: >=4.2, <=4.3
- heimrichhannot/contao-blocks: ~1.0
- heimrichhannot/contao-formhybrid: ^3.0
- heimrichhannot/contao-multi_column_editor: ~1.1
Suggests
- heimrichhannot/contao-frontendedit: A generic module using formhybrid for listing, editing, and deleting entities.
- dev-master
- 5.11.0
- 5.10.1
- 5.10.0
- 5.9.0
- 5.8.1
- 5.8.0
- 5.7.0
- 5.6.0
- 5.5.2
- 5.5.1
- 5.5.0
- 5.4.1
- 5.4.0
- 5.3.7
- 5.3.6
- 5.3.5
- 5.3.4
- 5.3.3
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.1
- 5.2.0
- 5.1.0
- 5.0.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.4.6
- 3.4.5
- 3.4.4
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.0
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.32
- 2.3.31
- 2.3.30
- 2.3.29
- 2.3.28
- 2.3.27
- 2.3.26
- 2.3.25
- 2.3.24
- 2.3.23
- 2.3.22
- 2.3.21
- 2.3.20
- 2.3.19
- 2.3.18
- 2.3.17
- 2.3.16
- 2.3.15
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.14
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.27
- 2.1.26
- 2.1.25
- 2.1.24
- 2.1.23
- 2.1.22
- 2.1.21
- 2.1.20
- 2.1.19
- 2.1.18
- 2.1.17
- 2.1.16
- 2.1.15
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-09-21 12:58:58 UTC
README
包含一个通用的列表和读取模块。这些模块可以显示和处理所有包含过滤、分页、模态处理等的contao实体。
如果需要额外的功能,只需继承自ModuleList或ModuleReader。
-> 点击 这里 查看模块formhybrid、formhybrid_list、frontendedit 和 submissions 之间交互的图表。
功能
列表模块
- 显示任何contao实体
- 按字段或自由文本排序
- 分页(ajax或同步)
- 无限滚动
- 使用heimrichhannot/contao-formhybrid的高级过滤
- 定义默认过滤器
- 具有别名支持的详细链接
- 在模态窗口中打开实例(为此请安装heimrichhannot/contao-modal)
- 以可排序标题的表格形式显示
- 在列表中共享实体(在dca之前使用
FormHybridList::addShareFields()
添加必要的字段)
读取模块
- 显示任何contao实体
- 支持id或别名
- 安全处理
技术说明
在列表项模板中访问数据
通常您会希望覆盖formybrid_list_item_default.html5模板。在这个模板内部,您可以使用以下技术访问链接实体的字段
- $this->someField
- $this->fields (格式化字段)
- $this->raw (以数据库中存储的未格式化字段)
用于masonry的示例CSS
.formhybrid-list {
.items {
.make-row();
.item, .stamp-item {
.make-xs-column(12);
.make-sm-column(6);
.make-md-column(4);
.make-lg-column(4);
margin-bottom: 40px;
}
}
}
自定义列表过滤器处理行为
只需创建ModuleList的子模块,添加以下函数并调整以满足您的需求(同样适用于customizeDefaultFilters(),它是初始过滤器)。
提示:您也可以为单个字段返回多个值作为数组。
protected function customizeFilters(&$strField, &$strColumn, &$varValue, &$blnSkipValue = false)
{
$arrData = $this->objFilterForm->getDca();
switch ($strField)
{
case 'startDate':
$strColumn = 'startDate >= ?';
$varValue = strtotime(str_replace('%', '', $varValue));
break;
case 'endDate':
$strColumn = 'startDate <= ?';
$varValue = strtotime(str_replace('%', '', $varValue));
break;
case 'city':
$strColumn = 'city = ?';
$varValue = $arrData['fields'][$strField]['options'][$varValue];
break;
case 'fsonly':
if (\Input::get('fsonly') === '0')
{
$strColumn = 'pid != 1';
}
else if (\Input::get('fsonly') === '1')
{
$strColumn = 'pid = 1';
}
break;
}
}