PHPackages                             heimrichhannot/contao-formhybrid\_list - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heimrichhannot/contao-formhybrid\_list

ActiveContao-module[Utility &amp; Helpers](/categories/utility)

heimrichhannot/contao-formhybrid\_list
======================================

Contains a list and a reader module in a generic flavor. The modules can display and process all kinds of contao entities containing filtering, pagination, modal handling, ...

5.11.0(3y ago)35.5k1LGPL-3.0-or-laterPHPPHP ^7.1 || ^8.0

Since Sep 29Pushed 3y ago8 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-formhybrid_list)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-formhybrid_list)[ Docs](https://github.com/heimrichhannot/contao-formhybrid_list)[ RSS](/packages/heimrichhannot-contao-formhybrid-list/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (188)Used By (1)

Formhybrid List
===============

[](#formhybrid-list)

Contains a list and a reader module in a generic flavor. The modules can display and process all kinds of contao entities containing filtering, pagination, modal handling, ...

If additional functionality is needed, one simply has to inherit from ModuleList or ModuleReader.

-&gt; Click [here](docs/formhybrid.png) for a diagram visualizing the interaction between the modules [formhybrid](https://github.com/heimrichhannot/contao-formhybrid), [formhybrid\_list](https://github.com/heimrichhannot/contao-formhybrid_list), [frontendedit](https://github.com/heimrichhannot/contao-frontendedit) and [submissions](https://github.com/heimrichhannot/contao-submissions).

Features
--------

[](#features)

### List module

[](#list-module)

- display any contao entity
- sorting by field or free text
- pagination (ajax or synchronous)
- infinite scroll
- advanced filtering using heimrichhannot/contao-formhybrid
- defining of default filters
- detail links with alias support
- opening instances in modal windows (install heimrichhannot/contao-modal for this)
- display as table with sortable headers
- share entities in a list (add the necessary fields to your dca beforehands by using `FormHybridList::addShareFields()`)

### Reader module

[](#reader-module)

- display any contao entity
- support for id or alias
- security handling

Technical instructions
----------------------

[](#technical-instructions)

### Access to data in list item templates

[](#access-to-data-in-list-item-templates)

Usually you'll want to override the formybrid\_list\_item\_default.html5 template. Inside this template you have access to the fields of the linked entity using the following techniques:

- $this-&gt;someField
- $this-&gt;fields (formatted fields)
- $this-&gt;raw (unformatted fields as stored in the database)

### Example CSS for the masonry

[](#example-css-for-the-masonry)

```
.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;
        }
    }
}

```

### Customize list filter processing behavior

[](#customize-list-filter-processing-behavior)

Just create a submodule of ModuleList, add the following function and adjust it to your needs (same is possible for customizeDefaultFilters() which are the initial filters).

Hint: You can also return multiple values for one field as array.

```
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
