Magento 2.x Relationship Between Block, Template & Layout

Templates:: Templates define the designing look of a page, these are files with the phtml extension, containing html markup. Which a specific Template need to render is determined by the layout file.

Layout:: Layout defines the structure of the page, It is a collection of Containers & columns of page.

There are 5 types of page layout for the frontend & 3 types of page layout for the backend

5 Types of page layout for the frontend

  • Empty
  • 1Column
  • 2Columns-left
  • 2Columns-right
  • 3Columns

3 Types of page layout for the backend

  • Admin-empty
  • Admin-1column
  • Admin-2columns-left

Dynamic Block:: Dynamic module blocks are collection of multiple methods, those are used in templates files, these files are rendered by xml layout file

The XML layout file defines which block and which template file will be called.

Leave a Reply

Your email address will not be published. Required fields are marked *