{"id":20961772,"url":"https://github.com/heimrichhannot/contao-filter-bundle","last_synced_at":"2025-07-09T06:08:28.908Z","repository":{"id":44571833,"uuid":"104480905","full_name":"heimrichhannot/contao-filter-bundle","owner":"heimrichhannot","description":"A generic filter for contao entities.","archived":false,"fork":false,"pushed_at":"2024-08-22T07:48:25.000Z","size":1482,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-25T06:52:00.191Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heimrichhannot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-22T14:01:38.000Z","updated_at":"2024-08-22T07:47:52.000Z","dependencies_parsed_at":"2023-02-08T19:01:08.160Z","dependency_job_id":"dd36bc97-916a-418e-9b54-dbdb17ec86c6","html_url":"https://github.com/heimrichhannot/contao-filter-bundle","commit_stats":{"total_commits":464,"total_committers":14,"mean_commits":"33.142857142857146","dds":0.6422413793103448,"last_synced_commit":"9da550a377846676301296b7b2720782315b2320"},"previous_names":[],"tags_count":260,"template":false,"template_full_name":null,"purl":"pkg:github/heimrichhannot/contao-filter-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-filter-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-filter-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-filter-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-filter-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimrichhannot","download_url":"https://codeload.github.com/heimrichhannot/contao-filter-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-filter-bundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264403797,"owners_count":23602621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T02:16:56.615Z","updated_at":"2025-07-09T06:08:28.891Z","avatar_url":"https://github.com/heimrichhannot.png","language":"PHP","readme":"# Contao filter bundle\n\n![](https://img.shields.io/packagist/v/heimrichhannot/contao-filter-bundle.svg)\n![](https://img.shields.io/packagist/dt/heimrichhannot/contao-filter-bundle.svg)\n\nThis bundle offers a generic filter module to use with arbitrary contao entities containing standard filter with initial filters and filter form types including [symfony form type representations](https://symfony.com/doc/current/reference/forms/types).\n\n## Features\n- Form handling using symfony form component \n- Form rendering by using symfony form templates (currently available: bootstrap 3-5, foundation, div, table)\n- Numerous [symfony form types](https://symfony.com/doc/4.4/reference/forms/types.html) supported\n- Highly customizable and detached from tl_module table\n- Label/Message handling using symfony translations\n- Render form always empty (without user selection)\n- Merge data over multiple filter forms with same form name\n- Default Values (can be overwritten by user)\n- Initial Values (can`t be overwritten by user)\n- Stores filter data in session (no GET parameter URL remnant)\n- Content element \"Filter-Preselect\" with optional redirect functionality to preselect filter on given page\n- Content element \"Filter-Hyperlink\" with filter preselect feature\n- Integrations:\n   - `codefog/contao-news_categories`\n   - `codefog/tags-bundle`\n   - `heimrichhannot/contao-categories-bundle`\n   - `heimrichhannot/contao-encore-bundle`\n\n## Usage\n\n### Install \n1. Install with composer or contao manager\n\n    ```\n    composer require heimrichhannot/contao-filter-bundle\n    ```\n   \n1. Update database\n\nWe recommend to use this bundle toghether with [List Bundle](https://github.com/heimrichhannot/contao-list-bundle) and [Reader Bundle](https://github.com/heimrichhannot/contao-reader-bundle).\n\n### Setup\n\n1. Create a filter configuration within System -\u003e Filter \u0026 sort configuration\n1. Add filter elements to the filter config.\n1. If you want to show the filter somewhere (for example to filter a list), create a filter/sort frontend module.\n\n### Wrapper elements (DateRange, ProximitySearch, ...)\n\nThe Wrapper element has to be places **before** the fields associated with them. \nFor example the date_range wrapper element needs to be placed before the two associated date fields.\n\n### Preselect\n\nFilter Bundle Forms are not typical GET-Forms, so it is not possible to simple \ncopy the filter urls to share or bookmark\na filtered list. To overcome this limitation, preselect urls can be generated.\nPreselect urls for the current filter can be found within template variabled, \nyou can create a preselect content element or get the url programmatically from \nthe FilterConfig.\n\n#### Template variables\nIf a filter is set, the variable `preselectUrl` contains the preselection url for\nthe current filter. It's available in the filter templates and the frontend module\ntemplate.\n\nYou can for example create a copy preselect url button:\n\n```twig\n{% if preselectUrl is defined and preselectUrl is not empty %}\n   \u003cdiv class=\"col-xd-12 col-md-3\"\u003e\n   \u003ca class=\"btn btn-primary\" onclick=\"navigator.clipboard.writeText('{{ preselectUrl }}');alert('Copied preselect link!');return false;\"\u003eFiltervorauswahllink kopieren\u003c/a\u003e\n   \u003c/div\u003e\n{% endif %}\n```\n\n#### Content element\nYou can use one of the following content elements:\n\n- \"Filter-Preselect\" with optional redirect functionality to preselect filter on given page\n- \"Filter-Hyperlink\" with filter preselect feature\n\n#### FilterConfig\n\nYou can generate the preselect link from the FilterConfig instance\n\n```php\n\u003c?php \nuse HeimrichHannot\\FilterBundle\\Manager\\FilterManager;\n\nclass CustomController {\n   private FilterManager $filterManager;\n   \n   public function invoke(): string\n   {\n       $filterConfig = $this-\u003efilterManager-\u003efindById($this-\u003eobjModel-\u003efilter);\n       return !empty($filterConfig-\u003egetData()) ? $filterConfig-\u003egetPreselectAction($filterConfig-\u003egetData(), true) : ''\n   }\n}\n```\n\n\n## Inserttags\n\nInsert tag | Arguments | Description\n--- | --------- | ------- \n`{{filter_reset_url::*::*}}` | filter ID :: page ID or alias | This tag will be replaced with a reset filter link to an internal page with (replace 1st * with the filter ID, replace 2nd * with the page ID or alias)\n\n## Further documentation\n\n[Developer introductions](docs/developers.md)\n[Templates](docs/templates.md)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-filter-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimrichhannot%2Fcontao-filter-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-filter-bundle/lists"}