Blocks are a way by which Magento distinguishes the array of functionalities in the system and creates a modular way to manage it from both visual and functional standpoint. There are two types of blocks and they work together to create the visual output.
Structural Blocks—These are blocks created for the sole purpose of assigning visual structure to a store page such as header, left column, main column and
footer.
Content Blocks—These are blocks that produce the actual content inside each structural block. They are
representations of each feature’s functionality
in a page and employ template files to generate xHTML to be inserted into its parent structural block. Category list, mini cart, product tags and product listing, etc, are
each its own content block. Instead of including template after template as a typical eCommerce application
would in order to gather the entire xHTML output, Magento gathers and arranges page content through blocks.
Layouts—These are the files that essentially map your content blocks to your structural blocks. Layouts in Magento have two functions—they define both the structural and
content blocks and then they inform Magento how and where to connect them up.
Không có nhận xét nào:
Đăng nhận xét