PHPackages                             heimrichhannot/contao-form-fields-collection-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. heimrichhannot/contao-form-fields-collection-bundle

ActiveContao-bundle[Templating &amp; Views](/categories/templating)

heimrichhannot/contao-form-fields-collection-bundle
===================================================

A collection of additional form fields for contao form generator.

0.2.2(4d ago)1534LGPL-3.0-or-laterPHPPHP ^8.2CI passing

Since Dec 1Pushed 5d ago6 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-form-fields-collection-bundle)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-form-fields-collection-bundle)[ Docs](https://github.com/heimrichhannot/contao-form-fields-collection-bundle)[ RSS](/packages/heimrichhannot-contao-form-fields-collection-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (16)Versions (16)Used By (0)

Form Field Collection Bundle
============================

[](#form-field-collection-bundle)

This bundle adds additional form fields to the Contao form generator.

Fields
------

[](#fields)

- Date/Time field - Field of html type date or time with native pickers (if supported by browser)
- Single Checkbox field - A single checkbox with a rich-text option label and configurable submitted value

Installation
------------

[](#installation)

Install the bundle via composer and update your database afterwards:

```
composer require heimrichhannot/contao-form-fields-collection-bundle

```

Usage
-----

[](#usage)

After install you'll find new form field types.

### Date/Time field

[](#datetime-field)

[![Frontend output of Date time widget](docs%2Fimg%2Fscreenshot_datetime_frontend.png)](docs%2Fimg%2Fscreenshot_datetime_frontend.png)

Select the field type "Date/ time" and select the format (date or time).

[![screeenshot_datetime.png](docs%2Fimg%2Fscreeenshot_datetime.png)](docs%2Fimg%2Fscreeenshot_datetime.png)

### Single Checkbox field

[](#single-checkbox-field)

Select the field type "Checkbox Single". Then configure the checkbox label in the `text` field and, if needed, define a custom submitted value in the `value` field. If no value is set, the checkbox submits `1`.

Like other Contao form fields, you can also mark the checkbox as mandatory and provide a help text.

[![Frontend Output Checkbox Single](docs/img/screenshot_checkbox.png)](docs/img/screenshot_checkbox.png)

#### Customize

[](#customize)

The template is made to be customized. Following variables are available:

VariableDescriptionoption\_wrapper\_element(string) Default 'span'option\_wrapper\_attributes(HtmlAttributes|null) The wrapper element attributescheckbox\_attributes(HtmlAttributes|null) The checkbox element attributeslabel\_attributes(HtmlAttributes|null) The label element attributeserror\_wrapper\_element(string) Default 'p'error\_wrapper\_attributes(HtmlAttributes|null) The error wrapper element attributesExample:

```
// Make it a bootstrap 5 one:
