Video Lesson: Change the page layout of a view in Magento

Change the page layout of a view in Magento

This is premium content

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

Change the page layout of a view in Magento

Change Magento page layout with XML layout attribute for 1column 2columns-right 3columns blog views.

Lesson Content

In the review of the exercise we just walked through, we noticed that the main layout on a page can be controlled by setting a layout attribute on the main <page> node, just as in this vendor/magento/module-theme/view/frontend/layout/default.xml default page layout of the Magento Theme module.

Since this default.xml is loaded and applied to all page views, all of our blog routes use the 3columns layout. Let’s confirm this by setting our sidebar in blog_post_detail.xml back to the sidebar.main container and refreshing the page. You’ll see that it has been placed in the left sid...

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.