- First, you create a list named "list" containing the IDs of the blocks you want to randomize.
- Use the "shuffle" filter to randomly rearrange the block list's elements.
- Then, you can access each block individually by indexing through the shuffled list.
When using the template, replace 'block ID' with the actual IDs of the blocks you want to include in the randomization.
Example:
{% set list = [ block('block ID'),block('block ID'),block('block ID'),block('block ID')] | shuffle %} {{list[0]}} {{list[1]}} {{list[2]}} {{list[3]}}Let's break down how it works to achieve the desired randomization of block order within your email template: