{"id":20961737,"url":"https://github.com/heimrichhannot/contao-list-bundle","last_synced_at":"2025-05-14T07:30:59.727Z","repository":{"id":46155685,"uuid":"117113374","full_name":"heimrichhannot/contao-list-bundle","owner":"heimrichhannot","description":"This bundle offers a generic list module.","archived":false,"fork":false,"pushed_at":"2024-12-18T10:51:14.000Z","size":931,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T05:17:55.958Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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.md","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}},"created_at":"2018-01-11T14:46:10.000Z","updated_at":"2024-12-18T10:51:13.000Z","dependencies_parsed_at":"2024-03-21T16:04:44.897Z","dependency_job_id":null,"html_url":"https://github.com/heimrichhannot/contao-list-bundle","commit_stats":{"total_commits":397,"total_committers":14,"mean_commits":"28.357142857142858","dds":0.5314861460957179,"last_synced_commit":"67c9f1cd2dd93d2dbac77a1a8b875ab275e6be66"},"previous_names":[],"tags_count":262,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-list-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-list-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-list-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-list-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimrichhannot","download_url":"https://codeload.github.com/heimrichhannot/contao-list-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254094828,"owners_count":22013648,"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:12.188Z","updated_at":"2025-05-14T07:30:57.588Z","avatar_url":"https://github.com/heimrichhannot.png","language":"PHP","readme":"# Contao List Bundle\n\n[![](https://img.shields.io/packagist/v/heimrichhannot/contao-list-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-list-bundle)\n[![](https://img.shields.io/packagist/dt/heimrichhannot/contao-list-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-list-bundle)\n[![Build Status](https://travis-ci.org/heimrichhannot/contao-list-bundle.svg?branch=master)](https://travis-ci.org/heimrichhannot/contao-list-bundle)\n[![Coverage Status](https://coveralls.io/repos/github/heimrichhannot/contao-list-bundle/badge.svg?branch=master)](https://coveralls.io/github/heimrichhannot/contao-list-bundle?branch=master)\n\nThis bundle offers a generic list module to use with arbitrary contao entities containing standard list handling like pagination, sorting, and filtering.\n\nIt makes it possible to generate lists not only for events, news or faq's but with every DCA you like.\n\n## Features\n- generic list module to use with arbitrary contao entities\n- support all form of standard list handling like pagination, sorting, filtering\n- works together with filter bundle\n- inheritable list configurations\n- template are build in twig\n- support for [Encore Bundle](https://github.com/heimrichhannot/contao-encore-bundle)\n\n## Usage\n\n### Install\n\n1. Install via composer (`composer require heimrichhannot/contao-list-bundle`) or contao manager\n1. Update your database\n\nRecommendations:\n- use this bundle together with [Reader Bundle](https://github.com/heimrichhannot/contao-reader-bundle).\n- use [Encore Bundle](https://github.com/heimrichhannot/contao-encore-bundle) for managing your frontend assets\n\n### Usage\n\n\u003e HINT: You can do the following steps for a basic list setup also in an interactive command. Simply run `vendor/bin/contao-console huh-list:make` in your contao root.\n\n1. Setup a filter (see [Filter Bundle](https://github.com/heimrichhannot/contao-filter-bundle) setup)\n1. Create a list config (System -\u003e List config)\n    * To add list elements like images, videos, slider etc, add list config elements (see Concepts -\u003e List config elements for explanation)\n    * Recommendation: for better performance, check \"Limit formatted fields\" in your list configuration and select only the fields you really need to have formatted\n1. Create a list frontend module and output it, where you like it\n\n## Concepts\n\n### Inheritable list configuration\n\nSince list configuration can be lots of data sometimes we decided to outsource it into a dedicated DCA entity.\nThese entities can be assigned to one or even multiple list modules in a reusable way.\n\nIn addition it's possible to create list configs that inherit from other list configs.\nHence overriding a single option while keeping everything else is possible.\n\n### The Item class\n\nEvery database record output in a list (e.g. an event) is modelled and wrapped by the `Item` class. The concrete class is `DefaultItem`. You can imagine\nthe item as a kind of ORM (object-relational-mapping).\n\nThe most important properties of an item are the arrays `raw` and `formatted` which also can be iterated in the list item template:\n\n- `raw`: contains the raw database values\n- `formatted`: contains the formatted representation of the raw values\n\nExample: Let's say a database record has a field `startDate` which holds a unix timestamp of the date chosen in the backend.\nThen `raw` contains this unix timestamp and `formatted` contains the pretty printed date according to the `dateFormat` set in\nthe contao settings, i.e. \"2020-09-12\".\n\nThe list bundle uses the method `FormUtil::prepareSpecialValueForOutput()` in [heimrichhannot/contao-utils-bundle](https://github.com/heimrichhannot/contao-utils-bundle)\nfor handling special values. It supports a wide range of types of special values:\n- date/time fields\n- arrays\n- fields with `options`, `options_callback` and entries in the DCA's `reference` key\n- binary fields (files, images, ...)\n- ...\n\nYou can access both of these arrays in your list item twig template as you normally would in twig:\n\n```twig\n{% for field, value in raw %}\n{% endfor %}\n\n{% for field, value in formatted %}\n{% endfor %}\n```\n\n**CAUTION:** By default all values of a database record are formatted and accessible in the item template. As you can imagine\nif some of the fields have thousands of options, the process of formatting can take some time and can reduce the peformance\nof your website. **Hence you always should limit the formatted fields and only format these you really need.** You can adjust that\nin the list configuration (field `limitFormattedFields`).\n\nFor convenience reasons you can also access the field values like so in your twig template:\n\n```twig\n{{ fieldname }}\n```\n\nIf you configured the field `fieldname` to be formatted, it will contain the formatted value. If not, the raw one. If\nit's formatted, you can still access its raw value by using:\n\n```twig\n{{ raw.fieldname }}\n```\n\n### List config elements\n\nEvery list config can have one or more list config elements. These are designed to specify things that can occur\nmultiple times (e.g. because there are many fields of one type).\n\nCurrently available list config element types:\n\nType          | Description\n--------------|------------\nimage         | Configure the output of one or more image fields separately (image size, placeholder handling, ...)\ntags          | Output one or more tag fields based on [codefog/tags-bundle](https://github.com/codefog/tags-bundle).\nrelated items | Output related items based on given tags (needs [codefog/tags-bundle](https://github.com/codefog/tags-bundle)) or categories (needs [heimrichhannot/contao-categories-bundle](https://github.com/heimrichhannot/contao-categories-bundle)).\n\n#### Image\n\nYou can add images either as formatted value of, if you also like to have additional features like image size processing\nor automatic placeholders if no image is set, you can use the *image list config element*.\n\nAfter the configuration you can output it as follows in your item template:\n\n```twig\n{% if images|default and images.myImage|default %}\n    {{ include('@HeimrichHannotContaoUtils/image.html.twig', images.myImage) }}\n{% endif %}\n```\n\n**IMPORTANT:** Note that by default the generated picture elements are added to an array called `images`. If your DCA\ncontains a field with the same name, you need to specify a different container name like e.g. `resizedImages`\n(using `overrideTemplateContainerVariable`).\n\n## Documentation\n\n[Developer documentation](docs/developers.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-list-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimrichhannot%2Fcontao-list-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-list-bundle/lists"}