Skip to content

Commit

Permalink
New chapters (#312)
Browse files Browse the repository at this point in the history
* update chapters for calculator
  • Loading branch information
iruzevic authored Mar 11, 2024
1 parent dda8c39 commit f95410f
Show file tree
Hide file tree
Showing 24 changed files with 281 additions and 56 deletions.
54 changes: 54 additions & 0 deletions website/forms/features/result-output.md
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).
:::
25 changes: 25 additions & 0 deletions website/forms/features/single-submit.md
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!
:::
20 changes: 10 additions & 10 deletions website/forms/integrations/active-campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ ActiveCampaign is an integrated email marketing, automation, sales software, and
* Form builder provided by the service.

### Supported fields:
* Full name
* First name
* Last name
* Hidden
* Textarea
* Email
* Phone
* Checkbox
* Radio
* Dropdown
* firstname
* lastname
* fullname
* hidden
* textarea
* email
* phone
* checkbox
* radio
* dropdown

25 changes: 13 additions & 12 deletions website/forms/integrations/airtable.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ Airtable is an platform that makes it easy to build powerful, custom application
* Form builder provided by the service.

### Supported fields:
* Input
* Email
* Url
* Number
* Date
* Phone number
* Textarea
* Single Select
* Multiple Choices
* Checkbox
* Currency
* MultipleRecordLinks
* singleLineText
* email
* url
* phoneNumber
* dateTime
* date
* number
* currency
* multilineText
* singleSelect
* multipleSelects
* checkbox
* multipleRecordLinks

:::caution
The Airtable MultipleRecordLinks field relies on the Airtable API to create records in a linked table.
Expand Down
8 changes: 8 additions & 0 deletions website/forms/integrations/calculator.md
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!
6 changes: 3 additions & 3 deletions website/forms/integrations/goodbits.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Goodbits is an service that helps you and your business create stellar newslette
* Form builder provided by the service.

### Supported fields:
* Email
* First name
* Last name
* email
* first_name
* last_name
19 changes: 12 additions & 7 deletions website/forms/integrations/greenhouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ Greenhouse is an sourcing automation tool to help hiring teams find, reach and e
* Form builder provided by the service.

### Supported fields:
* Phone
* Text
* Email
* File
* Textarea
* Select
* Checkbox
* input_text
* phone
* email
* text
* input_file
* textarea
* multi_value_single_select
* checkboxes
* select
* mapped_url_token
* longitude
* latitude
14 changes: 11 additions & 3 deletions website/forms/integrations/hubspot.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ Hubspot is an CRM platform that connects everything scaling companies need to de

* Form builder provided by the service.

### Not supported fields:
* Heading
* Paragraph
### Supported fields:
* text
* date
* number
* phonenumber
* file
* select
* booleancheckbox
* checkbox
* radio
* consent
22 changes: 12 additions & 10 deletions website/forms/integrations/mailchimp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ Mailchimp is an comprehensive email marketing platform that fulfills all your re
* Form builder provided by the service.

### Supported fields:
* Text
* Url
* Address - partially
* Zip
* Number
* Birthday
* Date
* Phone
* Radio
* Dropdown
* email_address
* text
* url
* address (partially)
* number
* zip
* phone
* birthday
* date
* birthday
* dropdown
* tags
11 changes: 6 additions & 5 deletions website/forms/integrations/mailerlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ MailerLite is an email service provider that makes it easier to plan email marke
* Form builder provided by the service.

### Supported fields:
* Text
* Date
* Number
* Phone
* Date
* text
* phone
* zip
* text
* date
* number
14 changes: 13 additions & 1 deletion website/forms/integrations/moments.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ Moments is an service that allows you to easily send relevant content derived fr
* Form builder provided by the service.

### Supported fields:
* All
* text
* country
* msisdn
* date
* datetime
* email
* number
* textarea
* dropdown
* country
* radiobutton
* checkbox
* checkbox_group
2 changes: 0 additions & 2 deletions website/forms/integrations/pipedrive.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ Pipedrive is a web-based Sales CRM and pipeline management solution that enables
* Form builder **not** provided by the service.
* The form is created using our forms fields and connected to Pipedrive fields using form settings.

### Supported fields:
* All
13 changes: 11 additions & 2 deletions website/forms/integrations/workable.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,14 @@ Workable is an sourcing automation tool to help hiring teams find, reach and eng
* Form builder provided by the service.

### Supported fields:
* All

* firstname
* lastname
* email
* short_text
* string
* phone
* file
* dropdown
* multiple_choice
* free_text
* boolean
30 changes: 30 additions & 0 deletions website/forms/php/filters/block/form/result-output-items.md
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 website/forms/php/filters/block/form/result-output-parts.md
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;
}
```


8 changes: 8 additions & 0 deletions website/forms/php/filters/integrations/calculator.mdx
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']} />
24 changes: 24 additions & 0 deletions website/forms/php/shortcodes.md
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]
```
Loading

0 comments on commit f95410f

Please sign in to comment.