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, ...
Installs: 4 972
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 9
Forks: 0
Open Issues: 0
Type:contao-module
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-11-21 13:16:37 UTC
README
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.
-> Click here for a diagram visualizing the interaction between the modules formhybrid, formhybrid_list, frontendedit and submissions.
Features
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
- display any contao entity
- support for id or alias
- security handling
Technical instructions
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->someField
- $this->fields (formatted fields)
- $this->raw (unformatted fields as stored in the database)
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
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 <= ?';
$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;
}
}