Dynamic Gutenberg Blocks
  • Home
  • Dynamic Gutenberg Blocks

ConditionalGutenberg Blocks

In addition to creating a trigger with multiple versions and embedding it on a page using a shortcode, you can now set a condition for each Gutenberg block.


How do I set a conditional Gutenberg block?

Well, this one is simple…

  1. Click on the block that you wish to modify. In the column on the right, click on “Dynamic Content”.
  2. Select a condition.

The block will be displayed only if the condition is met.

Conditional Gutenberg Block

How can I set the content that will be displayed if the condition is not met?

If the condition is not met, you have two options:

Option 1: Set default content. Simply, check the “Default Content” checkbox that can be found right below the condition. A new field will appear in which you can set the default content. The field only accepts HTML.

Default Content

Option 2: Duplicate the block and set a condition that is the exact opposite of the one you have set before. For example, if the condition of the first block is to show the block only on the first visit, set the condition of the second block to show content only after the first visit.

Conditional Gutenberg blocks vs. creating a trigger – what are the differences?

While the simplicity of designing the content with Gutenberg and displaying a block based on conditions is pretty obvious, there are several options that are only available while creating a trigger and embedding it on the site:

  1. Recurrence
  2. A/B Testing Condition
  3. Built-in Analytics
  4. Start & End Date Condition (coming soon)
  5. Schedule Condition (coming soon)

Setting up the geolocation condition for Gutenberg block

We’re working on ironing out all the kinks, but in the meantime, when using the geolocation condition, you will need to use country and state codes rather than choosing a name from a drop-down list.

GutenbergCountry Level

To target a Gutenberg block at the country level, set up a geolocation condition and paste the country code in the “country-level” field. To target a Gutenberg block at the country level, set up a geolocation condition and paste the country code in the “country level” field. https://www.if-so.com/country-codes-and-states-names-iso-3166/

” target=”_blank” rel=”noreferrer noopener”>c

Gutenberg: State Level

To target a Gutenberg Block at the state level, set up a geolocation condition and paste the state name in the “state level” field. The name should start with a capital letter (Example: New York, Illinois, Texas).

City Level

We use the naming format specified here: geonames.org. Search for the city you wish to target and enter the name exactly as it appears (make sure the name starts with a Capital letter)

Ready to get started?
Try it on your website