Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robuust/craft-formdesk
Formdesk plugin for Craft CMS
https://github.com/robuust/craft-formdesk
Last synced: 28 days ago
JSON representation
Formdesk plugin for Craft CMS
- Host: GitHub
- URL: https://github.com/robuust/craft-formdesk
- Owner: robuust
- License: mit
- Created: 2022-05-18T06:22:31.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-21T11:15:02.000Z (4 months ago)
- Last Synced: 2024-11-08T16:05:11.904Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Formdesk plugin for Craft
=================Plugin that allows you to display Formdesk forms
## Requirements
This plugin requires Craft CMS 4.0.0 or later.
## Installation
To install the plugin, follow these instructions.
1. Open your terminal and go to your Craft project:
cd /path/to/project
2. Then tell Composer to load the plugin:
composer require robuust/craft-formdesk
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Formdesk.
## Config
Create a file called `formdesk.php` in you Craft config folder with the following contents:
```php
'YOUR_HOST',
'apiKey' => 'YOUR_API_KEY',
];```
## Usage
Create a new "Formdesk" field and add it to the desired element's field layout.
Now when editing such element you can select a Formdesk list to use.In your front-end templates you can render this Formdesk list as a form.
## Example
Here is an example that renders a Formdesk form. You can change and style this example any way you want.
```twig
{% if errors is defined %}
{{ errors.message|t }}
{% endif %}
{{ csrfInput() }}
{{ actionInput('formdesk/submit') }}
{{ redirectInput('url_to_redirect_to') }}
{% for field in entry.form %}
{% switch field.type %}
{% case 'radio' or 'checkbox' %}
{% for option in field.options %}
{{ option.text }}
{% endfor %}
{% default %}
{% endswitch %}
{% endfor %}
```