heimrichhannot / contao-filter-bundle
通用的contao过滤器。
2.0.0-beta1
2024-03-06 16:52 UTC
Requires
- php: ^8.0
- ext-pdo: *
- ausi/slug-generator: ^1.0
- codefog/contao-haste: ^4.18 || ^5.0
- codefog/tags-bundle: ^2.0 || ^3.3
- contao/core-bundle: ^4.13 || ^5.0
- heimrichhannot/contao-be_explanation-bundle: ^2.5@beta
- heimrichhannot/contao-encore-contracts: ^1.0
- heimrichhannot/contao-entity-filter-bundle: ^1.11@beta
- heimrichhannot/contao-fieldpalette-bundle: ^0.6.12 || ^1.0@beta
- heimrichhannot/contao-multi-column-editor-bundle: ^2.0
- heimrichhannot/contao-utils-bundle: ^2.226 || ^3.0
- symfony/config: ^4.4 || ^5.0 || ^6.0
- symfony/dependency-injection: ^4.4 || ^5.0 || ^6.0
- symfony/event-dispatcher: ^4.4 || ^5.0 || ^6.0
- symfony/event-dispatcher-contracts: ^1.0 || ^2.0 || ^3.0
- symfony/form: ^4.4 || ^5.0 || ^6.0
- symfony/framework-bundle: ^4.4 || ^5.0 || ^6.0
- symfony/http-foundation: ^4.4 || ^5.0 || ^6.0
- symfony/http-kernel: ^4.4 || ^5.0 || ^6.0
- symfony/intl: ^4.4 || ^5.0 || ^6.0
- symfony/options-resolver: ^4.4 || ^5.0 || ^6.0
- symfony/property-access: ^4.4 || ^5.0 || ^6.0
- symfony/routing: ^4.4 || ^5.0 || ^6.0
- symfony/translation: ^4.4 || ^5.0 || ^6.0
- symfony/translation-contracts: ^1.0 || ^2.0 || ^3.0
- twig/extra-bundle: ^3.0
- twig/html-extra: ^2.12 || ^3.0
- twig/intl-extra: ^2.12 || ^3.0
- twig/string-extra: ^2.12 || ^3.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- contao/test-case: 1.1.*
- friendsofphp/php-cs-fixer: ^2.2
- heimrichhannot/contao-categories-bundle: ^1.0-beta
- heimrichhannot/contao-test-utilities-bundle: ^0.1
- php-coveralls/php-coveralls: ^2.0
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/phpunit: ^6.5
- symfony/phpunit-bridge: ^3.2
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
- heimrichhannot/contao-blocks: <2.0@beta
- dev-master
- 2.0.0-beta1
- 1.30.4
- 1.30.3
- 1.30.2
- 1.30.1
- 1.30.0
- 1.29.0
- 1.28.5
- 1.28.4
- 1.28.3
- 1.28.2
- 1.28.1
- 1.28.0
- 1.27.2
- 1.27.1
- 1.27.0
- 1.26.0
- 1.25.9
- 1.25.8
- 1.25.7
- 1.25.6
- 1.25.5
- 1.25.4
- 1.25.3
- 1.25.2
- 1.25.1
- 1.25.0
- 1.24.0
- 1.23.7
- 1.23.6
- 1.23.5
- 1.23.4
- 1.23.3
- 1.23.2
- 1.23.1
- 1.23.0
- 1.22.6
- 1.22.5
- 1.22.4
- 1.22.3
- 1.22.2
- 1.22.1
- 1.22.0
- 1.21.3
- 1.21.2
- 1.21.1
- 1.21.0
- 1.20.7
- 1.20.6
- 1.20.5
- 1.20.4
- 1.20.3
- 1.20.2
- 1.20.1
- 1.20.0
- 1.19.3
- 1.19.2
- 1.19.1
- 1.19.0
- 1.18.1
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.2
- 1.13.1
- 1.13.0
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.0
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 1.0.0-beta130.2
- 1.0.0-beta130.1
- 1.0.0-beta130
- 1.0.0-beta129.1
- 1.0.0-beta129
- 1.0.0-beta128.7
- 1.0.0-beta128.6
- 1.0.0-beta128.5
- 1.0.0-beta128.4
- 1.0.0-beta128.3
- 1.0.0-beta128.2
- 1.0.0-beta128.1
- 1.0.0-beta128
- 1.0.0-beta127
- 1.0.0-beta126
- 1.0.0-beta125
- 1.0.0-beta124
- 1.0.0-beta123
- 1.0.0-beta122
- 1.0.0-beta121
- 1.0.0-beta120
- 1.0.0-beta119
- 1.0.0-beta118
- 1.0.0-beta117
- 1.0.0-beta116
- 1.0.0-beta115
- 1.0.0-beta114
- 1.0.0-beta113
- 1.0.0-beta112
- 1.0.0-beta111
- 1.0.0-beta110
- 1.0.0-beta109
- 1.0.0-beta108
- 1.0.0-beta107
- 1.0.0-beta106
- 1.0.0-beta105
- 1.0.0-beta104
- 1.0.0-beta103
- 1.0.0-beta102
- 1.0.0-beta101
- 1.0.0-beta100
- 1.0.0-beta99
- 1.0.0-beta98
- 1.0.0-beta97
- 1.0.0-beta96
- 1.0.0-beta95
- 1.0.0-beta94
- 1.0.0-beta93
- 1.0.0-beta92
- 1.0.0-beta91
- 1.0.0-beta90
- 1.0.0-beta89
- 1.0.0-beta88
- 1.0.0-beta87
- 1.0.0-beta86
- 1.0.0-beta85
- 1.0.0-beta84
- 1.0.0-beta83
- 1.0.0-beta82
- 1.0.0-beta81
- 1.0.0-beta80
- 1.0.0-beta79
- 1.0.0-beta78
- 1.0.0-beta77
- 1.0.0-beta76
- 1.0.0-beta75
- 1.0.0-beta74
- 1.0.0-beta73
- 1.0.0-beta72
- 1.0.0-beta71
- 1.0.0-beta70
- 1.0.0-beta69
- 1.0.0-beta68
- 1.0.0-beta67
- 1.0.0-beta66
- 1.0.0-beta65
- 1.0.0-beta64
- 1.0.0-beta63
- 1.0.0-beta62
- 1.0.0-beta61
- 1.0.0-beta60
- 1.0.0-beta59
- 1.0.0-beta58
- 1.0.0-beta57
- 1.0.0-beta56
- 1.0.0-beta55
- 1.0.0-beta54
- 1.0.0-beta53
- 1.0.0-beta52
- 1.0.0-beta51
- 1.0.0-beta50
- 1.0.0-beta49
- 1.0.0-beta48
- 1.0.0-beta47
- 1.0.0-beta46
- 1.0.0-beta45
- 1.0.0-beta44
- 1.0.0-beta43
- 1.0.0-beta42
- 1.0.0-beta41
- 1.0.0-beta40
- 1.0.0-beta39
- 1.0.0-beta38
- 1.0.0-beta37
- 1.0.0-beta36
- 1.0.0-beta35
- 1.0.0-beta34
- 1.0.0-beta33
- 1.0.0-beta32
- 1.0.0-beta31
- 1.0.0-beta30
- 1.0.0-beta29
- 1.0.0-beta28
- 1.0.0-beta27
- 1.0.0-beta26
- 1.0.0-beta25
- 1.0.0-beta24
- 1.0.0-beta23
- 1.0.0-beta22
- 1.0.0-beta21
- 1.0.0-beta20
- 1.0.0-beta19
- 1.0.0-beta18
- 1.0.0-beta17
- 1.0.0-beta16
- 1.0.0-beta15
- 1.0.0-beta14
- 1.0.0-beta13
- 1.0.0-beta12
- 1.0.0-beta11
- 1.0.0-beta10
- 1.0.0-beta9
- 1.0.0-beta8
- 1.0.0-beta7
- 1.0.0-beta6
- 1.0.0-beta5
- 1.0.0-beta4
- 1.0.0-beta3
- 1.0.0-beta2
- 1.0.0-beta1
- 1.0.0-beta
- dev-contao5
- dev-feature/newscategories
- dev-encore-contracts
- dev-feature/filter_preselect_options
- dev-feature/contao49
- dev-fix/invalidDataTypesOutdatedValues
- dev-filter-type-refactoring
- dev-feature/hide_label_check
- dev-fix/sql_type_intial
This package is auto-updated.
Last update: 2024-09-22 07:57:03 UTC
README
此插件提供了一个通用的过滤器模块,可用于任意contao实体,包含标准的过滤器,初始过滤器以及过滤器表单类型,包括symfony表单类型表示。
特性
- 使用symfony表单组件处理表单
- 使用symfony表单模板渲染表单(目前可用:bootstrap 3-5,foundation,div,table)
- 支持许多symfony表单类型
- 高度可定制,并与tl_module表解耦
- 使用symfony翻译处理标签/消息
- 始终渲染空表单(不包含用户选择)
- 合并具有相同表单名称的多个过滤器表单中的数据
- 默认值(可被用户覆盖)
- 初始值(不能被用户覆盖)
- 将过滤器数据存储在会话中(无GET参数URL残留)
- 内容元素"Filter-Preselect",具有可选的重定向功能,用于在指定页面上预选过滤器
- 内容元素"Filter-Hyperlink",具有过滤器预选功能
- 集成
codefog/contao-news_categories
codefog/tags-bundle
heimrichhannot/contao-categories-bundle
heimrichhannot/contao-encore-bundle
使用方法
安装
-
使用composer或contao管理器安装
composer require heimrichhannot/contao-filter-bundle
-
更新数据库
我们建议将此插件与List Bundle和Reader Bundle一起使用。
设置
- 在系统 -> 过滤器 & 排序配置中创建过滤器配置
- 将过滤器元素添加到过滤器配置中。
- 如果您想在某个地方显示过滤器(例如过滤列表),则创建一个过滤器/排序前端模块。
包装元素(DateRange,ProximitySearch等)
包装元素必须放在相关字段之前。例如,date_range包装元素需要放在两个相关日期字段之前。
预选
过滤器插件表单不是典型的GET表单,因此无法简单地复制过滤器URL来共享或保存过滤后的列表。为了克服这一限制,可以生成预选URL。可以在模板变量中找到当前过滤器的预选URL,您可以创建预选内容元素或从FilterConfig中程序化地获取URL。
模板变量
如果设置了过滤器,变量preselectUrl
包含当前过滤器的预选URL。它在过滤器模板和前端模块模板中可用。
例如,您可以创建一个复制预选URL的按钮
{% if preselectUrl is defined and preselectUrl is not empty %} <div class="col-xd-12 col-md-3"> <a class="btn btn-primary" onclick="navigator.clipboard.writeText('{{ preselectUrl }}');alert('Copied preselect link!');return false;">Filtervorauswahllink kopieren</a> </div> {% endif %}
内容元素
您可以使用以下内容元素之一
- "Filter-Preselect",具有可选的重定向功能,用于在指定页面上预选过滤器
- "Filter-Hyperlink",具有过滤器预选功能
FilterConfig
您可以从FilterConfig实例生成预选链接
<?php use HeimrichHannot\FilterBundle\Manager\FilterManager; class CustomController { private FilterManager $filterManager; public function invoke(): string { $filterConfig = $this->filterManager->findById($this->objModel->filter); return !empty($filterConfig->getData()) ? $filterConfig->getPreselectAction($filterConfig->getData(), true) : '' } }