Render and wrap children blocks with containers in Magento
Render and wrap children blocks with containers in Magento layout XML using htmlTag and htmlId attributes.
Lesson Content
We already know that containers automatically render children blocks, which is how we got the blog.post.sidebar block rendering in the sidebar.main container. We just added the <block> node there, and it rendered:
<?xml version="1.0"?>
<page layout="2columns-right"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="main">
<block name="blog.pos...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.