Blocks
Desing with Twig Hooks
Configuration
Use the sylius_cms.shop:render:block
component and pass the following props:
code
The unique identifier of the collection you want to render.template
(optional) Path to a custom Twig template for rendering the block. When you provide your own template, you are responsible for rendering the content.context
(optional) Set the limitation for the product,
Example configuration
Design directly in Twig Template
Render the block
You can render the custom template by passing the appropriate option:
Context Configuration
The context prop allows you to pass additional variables to the block template. It supports three types: ProductInterface, TaxonInterface, or an array.
When you pass a ProductInterface or TaxonInterface as the context, the block will be rendered only if it is assigned to the corresponding product or taxon in the admin panel.
Last updated
Was this helpful?