Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Goran Alković <[email protected]>
  • Loading branch information
iruzevic and goranalkovic-infinum authored Oct 13, 2023
1 parent 0e1d5c7 commit dbc9de7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
12 changes: 6 additions & 6 deletions website/forms/features/wpml.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ id: wpml
title: WPML
---

WPML is a language plugin that allows you to translate your website into multiple languages. It is compatible with Eightshift Forms and can be used to translate your forms.
WPML is plugin that allows multi-lingual functionality for the website, allowing features like post and media translations. Eightshift Forms is fully compatible with WPML, and allows adding language variants (_translations_) to forms.

![WPML screen](/img/forms/wpml.webp)

## How to use

If you are using this plugin you should turn on this feature in the Eightshift Forms settings page. This will allow your forms to correctly display forms in the listing and form selection depending on the language you are using.
If using WPML, enable the _WPML_ feature in form settings. This will ensure the forms is displayed correctly in the form listing page, and that all the multi-language features work.

## Features affected by WPML

WPML affects the following features:

### Forms listing

By default, we use the `get_locale()` function to retrieve the default language of your project. Once the WPML plugin is activated, we assign a new language tag to each setting and display forms only in the specific language.
By default, we use `get_locale()`to retrieve the default language of the project. Once WPML is activated, a new language tag is assigned to each setting, and the forms display only in the language they're assigned to.

### Forms selector

When selecting forms in your forms picker, you will only see forms available in your language.
When selecting forms in the Forms picker, only the forms in the current editing language are visible.

### Forms settings

We will make each forms settings language specific.
Forms settings are unique for each language variant of the form.

### Global settings

Global settings will be language specific, except for API keys, tokens and etc.
Global settings, similar to form settings, are unique for each language variation, with the exception of API keys, tokens, etc.
31 changes: 18 additions & 13 deletions website/forms/first-form.mdx
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
---
id: first-form
title: Your First Form
title: Your first form
---

import { Video } from './../src/docs/videos';

To add your first form and disply it to the frontend users you need to:
1. Allow form type you want to use in the global setting dashboard.
2. Create a form in the admin panel.
3. Configure the forms settings.
4. Add the form to the page/post/custom post type.
Adding your first form and displaying it on the frontend is simple:
1. Enable the form type you want to use in the Eightshift forms Dashboard
2. Create a form in the WordPress admin
3. Configure the form and add the fields needed
4. Add the _Form picker_ block in the place you want to show the form, and select your newly created form

## Allow form type
## Integrations
By default none of the integrations are enabled.

To enable one, go to the _Dashboard_ page of the Eightshift Forms admin settings.

By default no form type is allowed. You need to go to the global settings dashboard and allow the form type you want to use.
More details can be found [here](features/dashboard).

![Dashboard screen](/img/forms/dashboard.webp)

## Create a form

To create a form you need to go to the admin panel and click on the `Forms` menu item. Then click on the `Add New` button.
On the edit page you need to select form type you would like to use. Depending on the form type you will see different fields and settings.
To create a form, open the WordPress admin, find _Eightshift Forms_ in the sidebar, then click on _Add new form_.

An editing screen will open, with a selector for the form type. If you don't see a form type in the selector, make sure it's enabled in the Dashboard.

After clicking the form type, the Form block will be automatically added, the form initialized, and some fields may be added by default.

![Form Type Picker screen](/img/forms/form-type-picker.webp)

To configure form settings you need to click on the `Settings` tab in the block sidebar.
To change form settings, clicking on `Edit settings` in the options sidebar.

![Forms Sidebar screen](/img/forms/forms-sidebar.webp)

## Add the form to the page/post/custom post type

To add the form to the frontend you need to add created form on your page/post/custom post types and use `forms block` to select the form you want to display.
To display the form, add the _Form_ block and select a form to display.

![Form picker screen](/img/forms/form-picker.webp)

To configure additional form setting you can use `forms block` sidebar.
More settings can be found in options sidebar.

![Form Sidebar screen](/img/forms/form-sidebar.webp)

Expand Down
6 changes: 4 additions & 2 deletions website/forms/php/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Helpers

Eightshift Forms offers static helpers that can be implemented in your project. The key difference between these helpers and filters is that you can use the former in your theme or plugin code regardless of the load cycle.

You can find all helpers on this [link](https://github.com/infinum/eightshift-forms/blob/develop/src/Helpers/esForms.php).
All helpers can be found [here](https://github.com/infinum/eightshift-forms/blob/develop/src/Helpers/esForms.php).

### esFormsGetFormIdByName

Expand Down Expand Up @@ -63,7 +63,9 @@ if (\function_exists('esFormsGetComponentsRender')) {

### esFormRenderForm

If you want to output a form in a custom template or block, you can use this helper to do so. However, it is important to note that this helper has limitations and doesn't provide all the functionality that a block editor does.
If you want to output a form in a custom template or block, you can use this helper to do so.

Please note that not all functionalities are available, and certain options might not be available.

```php
if (\function_exists('esFormRenderForm')) {
Expand Down
4 changes: 2 additions & 2 deletions website/src/docs/integration-filters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export function IntegrationFilters(props) {
{onlyUse.includes('order') &&
<>
<h2>Order fields</h2>
<p>Force specific form fields order. If you set the order of fields with this filter they will always fallback to this settings. All fields not defined by this filter will follow the default block editor insert order.</p>
<p>You don't need to define every field in the form. For example if you want to <code>firstname</code>, <code>lastname</code> and <code>email</code> to be first in order this filter will make this happen.</p>
<p>Forces a specific form fields order, regardless of one set in the editor. Fields that are not defined here will follow the natural in-editor order.</p>
<p>Not all fields need to have an order defined. For example, if you want to make sure <code>firstname</code>, <code>lastname</code> and <code>email</code> are displayed first, this filter can help.</p>

<CodeBlock language="php">
{reformatCode(`
Expand Down

0 comments on commit dbc9de7

Please sign in to comment.