The {{ document.layout }}
function allows you to embed one layout inside another, including all associated JavaScript and CSS resources. When a layout is included, its styles and scripts are automatically added to the <head> section of the HTML document.
All Twig tags present in the included layout’s CSS and JavaScript scripts will be processed
Usage:
{{ document.layout("Layout Name") }}
Parameters:
Layout Name
– The name of the layout to include.
Example:
{{ document.layout("my_script_layout") }}
Catalog Page Behavior
When used within a Catalog Page layout, this extension functions similarly to Simple Catalog Layout blocks. It will:
- Insert catalog items using the selected layout
- Process each item through the specified layout template
- Behave equivalently to the following Simple Catalog Layout structure:
{% block record %}
{# Content of the specified layout will be applied to each catalog item #}
the content of "my_script_layout" layout
{% endblock %}
Leave a Reply
You must be logged in to post a comment.