Static Blocks
Static Theme Blocks give theme developers greater control over how blocks and sections are structured. Unlike regular Theme Blocks, they are rendered statically in Liquid rather than dynamically.
Because of this, Static Theme Blocks are especially useful when:
A theme requires blocks that should not be moved or removed by the merchant
Blocks can be rendered conditionally,
having multiple places where you want to add nested blocks to a section
Static Theme Blocks still allow full access to customizable settings, ensuring flexibility without sacrificing control.
Static Theme Blocks can be created by adding the li-static-block attribute to a <div>:
li-static-block = Item{% content_for "Item", type: "type", id: "uniqueid" %}This generates a new block file, which is then referenced directly within the corresponding Liquid file.

and this: Inside this element, you can then use all the elements as usually. For example li-cf-theme-blocks to nest other blocks inside.
Loop or conditionally render static blocks.
To loop over or conditionally render a static block, simply wrap it in a div and add either li-for:inside or li-if:inside. This will also be reflected in the Shopify Theme Editor. Learn more about looping and conditional rendering here.

Adding Parameters to your Static Blocks
If you want to pass data into your static blocks, you can use the attribute modifier like this:
This allows you to access dynamic data from the for loop like this:

Last updated
Was this helpful?