[rank_math_breadcrumb]

Dynamic Forms

Dynamic Forms extend the standard way of embedding forms created with Greyd Forms into website content. While the regular Form block simply displays a selected form, Dynamic Forms combine form embedding with the dynamic capabilities known from the Dynamic Templates feature. This allows specific parts of a form to change depending on the context in which the form is displayed.

The functionality follows the same principles used by the Dynamic Templates and Dynamic Tags features. Instead of creating multiple versions of a form for different use cases, you can define certain form properties as dynamic and provide their values when the form is inserted into content.

Dynamic form variation

To display a form in website content, two different blocks are available: the Form block and the Dynamic form block. The Form block inserts a form without any dynamic processing and behaves exactly like previous versions of the feature. The Dynamic form block, a variation of the Template block, enables dynamic processing and allows all supported dynamic fields to be customized when the form is embedded.

Screenshot of the settings sidebar of a Dynamic form block. Being a variation of the existing Template block, it shows the same setting sections as a Template block.
The Dynamic form block is a variation of the Template block.

The process of selecting a form is identical for both blocks. After a form has been selected in the Dynamic form block, the block scans the form for fields that have dynamic overwrites enabled. For every distinct dynamic field name found, a corresponding control appears in the block sidebar, allowing you to define the value that should be used in the current context. If multiple attributes share the same dynamic field name, they are controlled together and filled with the same value.

Screenshot of a Dynamic form where Dynamic Elements have been enabled and show input fields in the settings sidebar.
If Dynamic Elements are enabled in a form, the input fields to change the content appear in the block sidebar of the inserted form.

Dynamic values can also be edited directly inside the editor preview where supported. For example, dynamic labels based on RichText fields can be modified without opening the sidebar. In addition, all dynamic fields support Dynamic Tags, making it possible to populate values automatically from the current page, post, user, or other available data sources.

If a form has already been inserted using the standard Form block, it can be converted into a Dynamic form block at any time. This can be done through the transform options in the block toolbar or by using the conversion link provided in the block sidebar.

Screenshot of a Template block showing the option to convert the block into a Dynamic form.
When a Template block exists in the content, it can be converted to a Dynamic form. The correct form needs to be selected for the transformation.

Dynamic Overwrites on form blocks

When creating a form with Greyd Forms, every form field block includes a Dynamic Overwrites option in its settings. This allows selected attributes of the field to be replaced dynamically when the form is displayed.

Screenshot of the input field block settings sidebar, with the section Dynamic Overwrites opened, showing two toggles for Label and Placeholder and a help text below them.
The Dynamic Overwrites section in the settings sidebar at the Input field block.

The label of every form field can be made dynamic. In addition, the placeholder text can be overwritten for Input field, Dropdown, Upload, and Password blocks. Depending on the block type, the field value or the available choices can also be made dynamic. This applies to Dropdown, Radio buttons, Radio button, Image panels, Image panel, and Hidden field blocks.

Several form field blocks also provide their own dynamic data options independently of the Dynamic Forms feature. Dropdown, Radio buttons, and Image panels all work with selectable options and support multiple methods of generating those options. Depending on the block type, options can be created through child blocks, manually managed value-label pairs, comma-separated option lists, or dynamically generated from posts and taxonomy terms. When using posts or terms, the available options are created automatically from the selected post type or taxonomy.

Screenshot of the Radio buttons block showing block settings, with the Options section opened and "Posts" selected as Entry Type. Below, a dropdown for selecting a post type appears.
Radio buttons block showing the block settings, with the Options section opened and “Posts” selected as Entry Type. Below, a dropdown for selecting a post type appears.

The Hidden field block already supports several methods for assigning dynamic values. Dynamic Forms adds the ability to overwrite these values dynamically when the form is embedded. For more information, refer to the Hidden field documentation.

Video

You are currently viewing a placeholder content from Vimeo. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information

Last updated: