Video Lesson: Render and wrap children blocks with containers in Magento

Render and wrap children blocks with containers in Magento

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

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...

Premium content

Enroll to unlock the full content and all course materials.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Comments

Want to comment on this lesson?

Enroll in this course to leave comments.