-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update chapters for calculator
- Loading branch information
Showing
24 changed files
with
281 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
id: result-output | ||
title: Result output | ||
--- | ||
|
||
_Result output_ allows displaying user-defined blocks after the form is submitted successfully. | ||
|
||
![Result output](/img/forms/result-output-1.webp) | ||
|
||
## Configuration | ||
|
||
Follow these steps: | ||
1. Add a _Result output item_ and keep its name in mind. Result outputs are found in the WordPress admin sidebar. | ||
2. Create a form | ||
3. Add the form to the desired page | ||
4. Add the _Result output_ block to the same page | ||
5. In the _Result output_ block options select the form and the Result output block you created in step 1 | ||
6. (Optional) Disable the global messages in the form settings | ||
|
||
Once the form is submitted the select block will be displayed. | ||
|
||
![Result output settings](/img/forms/result-output-2.webp) | ||
|
||
## _Result output item_ block | ||
|
||
Alongside the _Result output_ block you will find the _Result output item_ block. It allows changing parts of the result output or showing things like custom messages, based on user input. | ||
|
||
![Result output item block](/img/forms/result-output-3.webp) | ||
|
||
:::caution | ||
The block will not show anything by default. Some configuration by developers is required. For more details, check the chapter on [custom filters](/forms/php/filters/block/form/result-output-items). | ||
::: | ||
|
||
To configure the block, add it inside a _Result output_ block, and provide a name and a value that will match the data provided by the filter. Once the form is submitted and the condition matches, the selected block will be shown. | ||
|
||
:::tip | ||
Works great with the [Computed Fields Add-on](/forms/addons/premium/computed-fields/intro). | ||
::: | ||
|
||
## _Result output part_ shortcode | ||
|
||
Similar to the _Result output item_ block, the shortcode version allows smaller, inline varations, e.g. simple pieces of text. | ||
|
||
![Result output part shortcode](/img/forms/result-output-4.webp) | ||
|
||
:::caution | ||
The shortcode will not show anything by default. Some configuration by developers is required. For more details, check the chapter on [custom filters](/forms/php/filters/block/form/result-output-items). | ||
::: | ||
|
||
To configure the shortocde, add it somewhere inside the _Result output_ block. Provide a `name` and set the `default text`. The _default text_ will be shown after form submission if the _name_ matches the one in the configuration. | ||
|
||
:::tip | ||
Works great with the [Computed Fields Add-on](/forms/addons/premium/computed-fields/intro). | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
id: single-submit | ||
title: Single submit | ||
--- | ||
|
||
Single submit is a feature that allows dynamic processing of a form when user makes any change on the form. This is useful for forms that require users to perform calculations, such as a mortgage calculator or a loan calculator. | ||
|
||
![Single submit](/img/forms/single-submit.webp) | ||
|
||
You can turn on single submit in the settings of the form. | ||
|
||
Single submit form can work with and without a submit button, but in general it is recommended not to use a submit button with single submit forms. | ||
|
||
Not all form field are supported by single submit. The following fields are supported: | ||
* Input range | ||
* Checkbox | ||
* Radio | ||
* Rating | ||
* Select | ||
|
||
If you add any of the non-supported fields to a single submit form, the form will not submit when the user makes a change to the non-supported field. | ||
|
||
:::caution | ||
This feature may create a large number of request to your server. Use with caution! | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
id: calculator | ||
title: Calculator | ||
--- | ||
|
||
_Calculator_ is a service that allows turning a form into a calculator with custom programmable logic. For example, you can build a mortgage calculator. | ||
|
||
Please not that this is **not** an integration! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
website/forms/php/filters/block/form/result-output-items.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
id: result-output-items | ||
title: Result output items | ||
--- | ||
|
||
Allows modifying _Form result output parts_ using an API to change which block is shown on the frontend, based on the user input. | ||
|
||
Used by the `result-output-item` block. | ||
|
||
```php | ||
add_filter('es_forms_integrations_form_result_output_items', 'getIntegrationResultOutputItems', 10, 3); | ||
|
||
/** | ||
* Populate Result output items in the API response data used in 'result-output-item' block. | ||
* | ||
* @param array<string, mixed> $output Output data. | ||
* @param array<string, mixed> $formDetails Data passed from the 'getFormDetailsApi' function. | ||
* @param string $formId Form ID. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
function getIntegrationResultOutputItems(array $output, array $formDetails, string $formId): array | ||
{ | ||
$output['testKeys'] = 'testValue'; | ||
|
||
return $output; | ||
} | ||
``` | ||
|
||
|
30 changes: 30 additions & 0 deletions
30
website/forms/php/filters/block/form/result-output-parts.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
id: result-output-parts | ||
title: Result output parts | ||
--- | ||
|
||
Allows modifying _Form result output parts_ using an API to change which shortcode is output on the frontend, based on the user input. | ||
|
||
Used by the `esFormsROIP` shortcode. | ||
|
||
```php | ||
add_filter('es_forms_integrations_form_result_output_parts', 'getIntegrationResultOutputParts', 10, 3); | ||
|
||
/** | ||
* Populate result output parts in the API response data used in the 'esFormsROIP' shortcode. | ||
* | ||
* @param array<string, mixed> $output Output data. | ||
* @param array<string, mixed> $formDetails Data passed from the 'getFormDetailsApi' function. | ||
* @param string $formId Form ID. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
function getIntegrationResultOutputParts(array $output, array $formDetails, string $formId): array | ||
{ | ||
$output['testKeys'] = 'testValue'; | ||
|
||
return $output; | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
id: calculator | ||
title: Calculator | ||
--- | ||
|
||
import { IntegrationFilters } from './../../../../src/docs/filters'; | ||
|
||
<IntegrationFilters name="Calculator" filter="calculator" onlyUse={['prePostParamsFilter']} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
id: shortcodes | ||
title: Shortcodes | ||
--- | ||
|
||
## What are shortcodes? | ||
|
||
Shortcodes are small pieces of code that allow adding forms to the site in places blocks can't be easily added. | ||
|
||
## esFormsLink | ||
|
||
This shortcode allows adding links within text labels, e.g. if you need to add a privacy policy link to a form checkbox label. | ||
|
||
```php | ||
[esFormsLink url="https://eightshift.com" label="Eightshift" /] | ||
``` | ||
|
||
## esFormsROIP | ||
|
||
The `esFormsROIP` (_Result output item part_) shortcode allows showing certain content inline, based on the user input. The content is shown if the provided `name` matches the fields defined within filters. | ||
|
||
```php | ||
[esFormsROIP name="<key>"]Default content[/esFormsROIP] | ||
``` |
Oops, something went wrong.