Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heimrichhannot/contao-enhanced-accordions-bundle
This bundle enhances the work with contao accordions for template designers and developers.
https://github.com/heimrichhannot/contao-enhanced-accordions-bundle
Last synced: about 1 month ago
JSON representation
This bundle enhances the work with contao accordions for template designers and developers.
- Host: GitHub
- URL: https://github.com/heimrichhannot/contao-enhanced-accordions-bundle
- Owner: heimrichhannot
- License: lgpl-3.0
- Created: 2023-12-04T14:48:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-05T13:52:27.000Z (about 1 year ago)
- Last Synced: 2024-11-14T17:12:54.294Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Enhanced accordions bundle
This bundle enhances the work with contao accordions for template designers and developers.
## Features
- add additional variables to accordions templates to create templates groups
- optional bootstrap 5 enhancements for the default templates
- bundles bootstrap 5 accordion templates## Usage
### Install
Install with composer or contao manager and update your database.
```bash
composer require heimrichhannot/contao-enhanced-accordions-bundle
```### Use bootstrap 5 integration
![screenshot.png](docs%2Fimg%2Fscreenshot.png)
In your theme settings, select bootstrap 5 frontend framework and activate the checkbox "Adjust default template".
This adds some css classes and markup to make the default work with boostrap 5 javascript component.
This is no complete replacement, as the default templates can not completely adjust without overriding for bootstrap 5.The bundle also provides bootstrap 5 accordion templates, that can be selected as custom template, copied to project or extended in your project templates.
If you extend the templates, there are some adjustments you can make:
```twig
{% extends "@Contao_HeimrichHannotEnhancedAccordionsBundle/ce_accordionStart_bs5.html.twig" %}{% set open_first = true %}
{% set titleElement = 'h3' %}
``````twig
{% extends "@Contao_HeimrichHannotEnhancedAccordionsBundle/ce_accordionStop_bs5.html.twig" %}
``````twig
{% extends "@Contao_HeimrichHannotEnhancedAccordionsBundle/ce_accordionElement_bs5.html.twig" %}{% set open_first = true %}
{% set titleElement = 'h3' %}
```### Additional template variables
The bundle adds additional variables to the accordion templates, that can be used to enhance your templates.
A accordion group is defined by consecutively accordion start and stop elements OR single accordion elements.| Variable | Description |
|----------------------------|----------------------------------------------------------|
| `accordion_parentId` (int) | The id of the first element of the accordion group. |
| `accordion_first` (bool) | `true` if the element is the first element of the group. |
| `accordion_last` (bool) | `true` if the element is the last element of the group. |