- 04 Apr 2024
- 4 minute read
- Print
- DarkLight
- PDF
Dynamic Content Blocks
- Updated 04 Apr 2024
- 4 minute read
- Print
- DarkLight
- PDF
Dynamic content blocks enable streamlined creation of personalized content within mailings and form communications. Dynamic content blocks can make full use of merge fields, liquid markup, and even other content blocks!
All content blocks include dynamic content block functionality. Merge fields, liquid markup, and conditional logic can be added to both new and existing content blocks in the WYSIWYG editor or from the source code by manually inserting merge field formatting (such as the {{Person-Preferred}} field).
To avoid potential errors when placing dynamic content blocks within other dynamic content blocks, refer to the Recursion within Dynamic Content Blocks section of this article.
How to Use Dynamic Content Blocks
All content blocks support dynamic content block functionality. You can edit existing content blocks to contain dynamic content or create and configure new content blocks by following the Knowledge Base article on Creating Content Blocks. You can add liquid markup and merge fields to content blocks when you create them, or you can return and add them later.
✨ TipWhile you should create the content for a content block before adding it to a communication, including merge fields in a dynamic content block requires you to already know the names of the exports used as merge fields. The best way to be sure that your communication exports match the dynamic content block merge fields is to use the default export names when creating the dynamic content block.
For example, use {{Person-First}} instead of {{First-Name}}, since queries built upon Configurable Joins will name the export for a person's first name as "Person First" by default. Any spaces within export names will be automatically converted into hyphens.
Dynamic Content Blocks in Deliver Mailings
To add a dynamic content block to a Deliver Mailing, all exports used within the dynamic content block must be configured within the recipient lists for the mailing.
Create or edit the mailing that will include the dynamic content block.
Select Edit Recipient Lists. The Recipient Lists page appears.
Select an existing recipient list to edit it, or click New Query to generate a new recipient list. For more information on recipient lists, refer to the Adding a Recipient List Knowledge Base article.
If editing an existing recipient list, click Edit Query to open the query editor. Otherwise, clicking New Query in the previous step will open the query editor.
Click Export in the query editor to add the desired exports. Any information that will be used as a merge field or condition within the dynamic content block must be configured as an export within the recipient list.
For example, if the dynamic content block uses conditional logic to show only information about scholarships to students with a cumulative GPA of 3.5 or higher, "Cumulative GPA" must be selected as an export.Configure any desired filters for this communication as described in the Knowledge Base article on Adding a Recipient List.
Return to the mailing and click Edit Message. On the right side of the WYSIWYG editor, all of the previously-configured exports will appear as merge fields. The names of these exports must match the names of any merge fields contained within the dynamic content blocks.
Follow the guide in the Displaying Content Blocks Knowledge Base article to insert the dynamic content block into the message.
Use the Display Sample Message function in the mailing editor to test that the dynamic content blocks work as expected.
Dynamic Content Blocks in Form Communications
To add a dynamic content block to a form communication, all merge fields used within the dynamic content block must be added as exports for the communication.
Create or edit a form that will have a dynamic content block in its communications.
Click Edit Communications. The Communications summary page for the form appears.
To create a new mailing, click New Mailing. To edit an existing mailing, click Edit Mailing under the mailing details.
Click Edit Conditions. The Edit Conditions pop-up opens. Exclusivity Group, Exports, and Filters can be configured here.
Click Export to add the needed exports to the form communication. You can select from any data collected on the form, or you can join to other query bases to select other exports. Any information that will be used as a merge field or condition in the dynamic content block must be configured as an export within the recipient list. Once you have selected the exports, click Continue.
(For example, if the dynamic content block uses conditional logic to only show information about scholarships to students with a cumulative GPA of 3.5 or higher, cumulative GPA must be selected as an export.)Make sure that the names of the exports match the merge fields in the dynamic content block. To change the name of an export, double-click on the export in the Edit Conditions pop-up.
Click Save.
Use the Submit Form Test function in the mailing editor to test that the dynamic content blocks work as expected.
Recursion in Dynamic Content Blocks
Dynamic content blocks can call other content blocks. They can also pass exports through into merge fields within those content blocks. Using a content block embedded within another content block allows for simplified generation of personalized content, but also requires creators of dynamic content blocks to understand the limits of recursion.
Content blocks are limited to two levels of recursion, meaning that a content block can contain up to two more content blocks.
First Content Block (Top Level) OK
|
Placing too many levels of recursion within content blocks will generate the following error when attempting to save the content: