oveleon / contao-advanced-form
advanced-form extension for Contao Open Source CMS
Fund package maintenance!
oveleon
Installs: 650
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 6
Forks: 6
Open Issues: 0
Type:contao-bundle
Requires
- php: ^7.4 || ^8.0
- codefog/contao-haste: ~4.25
- contao/core-bundle: ^4.9
- symfony/expression-language: >=4.4
Requires (Dev)
- contao/manager-plugin: ^2.0
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
- terminal42/contao-mp_forms: *
README
The contao advanced form bundle adds a new form-field (Formpage) to forms that can be used for multipage-forms with conditions
Working with Contao 4.9 and up to Contao 4.13 (PHP ^7.4 and PHP 8) Cannot be installed together with MP_Forms from Terminal24
- Features
- How to install
- How does contao advanced form work?
- Initial setup
- Advanced setup for conditions
- Important Information
- Options
- Support
- License
- Sponsoring
Features
- Configurable formpage / pageswitch form-field with conditions for submitted values
- A Guest mode to show specific form pages for guests only
- Does not display form-pages when conditions are not met
- Sends all collected data on specific form page
- Compatible with all form-fields from contao
How to install the package
Install the package by using following command:
composer require oveleon/contao-advanced-form
After installing the contao-advanced-form-bundle, you should run a contao install to add the new fields.
The extension cannot be used or installed at the same time as MP_Forms from Terminal24
How does contao advanced form work
Once the installation is complete, you will be able to use a new field type called "Formpage" within Contao Forms that does act as a divider for created form fields (i.e.: radio button menu, textarea, etc.).
The 'formpage' form-field acts as a page-switch and you will be redirected to it if the condition from previous submitted values is met.
Initial setup
-
Set up your form as usual and create your form-fields
-
Create 'formpage' fields between the form-fields that should be divided into pages
-
Add a 'submit button label' into your form-page
-
In case you want a button to get to your previous page, add a 'back button label' as well
Advanced setup for conditions
-
Follow the initial setup mentioned above
-
Create values that can be submitted (e.g. Radio button menu) above the form-page that should meet the condition
-
Activate the "Add condition" checkbox and write your condition into it
Important Information
Creating Form Pages
-
The first form-page will always be divided by the first form-field and the first 'Formpage'-field.
-
Following form-pages are created by wrapping them with 'Formpage'-fields.
-
The last field in your form needs to be a 'Formpage'-field, otherwise it will show all form-fields (This is great to debug through your form).
Conditions
Conditions within page-switches (Formpages) will always work for the
FOLLOWING
form-fields up to the next page-switch (Formpage)
Syntax
${Field name of radio button menu} == '{Value of radio button menu}'
A radio button menu with a field name of 'Example1', and a submitted value of 'Option1' will jump to this page-switch (form-page).
$Example1 == 'Option1'
You are able to set-up complex conditions to show a certain form-page. The following PHP functions can be used within the condition:
- floatval
- strval
- intval
- in_array
- str_contains
If more functionality is needed, feel free to create a feature issue.
Buttons
The submit-button and back-button are set up for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
Classes
Classes will always be set for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
Protecting and hiding form-pages
Using the option 'protect form page' and 'show to guests only', will always work for the
PREVIOUS
form-page. They will work for the form-fields above the page-switch (Formpage).
Options
Support
We only provide support for bugs, and feature requests; please only post issues about these two topics.
If you need help implementing Contao Advanced Form or you are just starting out with Contao, please contact us on our website, visit the Contao Community or the Contao Slack, you will be able to find more help there.
This will help us to keep the issues related to this plugin and solve them faster.
License
This project is licensed under the AGPL-3.0 License — check LICENSE for more details.
Sponsoring
If you find this plugin useful, please consider sponsoring us to help contribute to our time invested and to further development of this and other open source projects. Thank you for your support! - Oveleon.