As we learned in Chapter 2, Magento Fundamentals for Developers, Magento separates its view layer into blocks, templates, and layout files. Blocks are objects that handle parts of the logic. Templates are phtml
files that are a mix of HTML and PHP code. Layout files are XML files that control the position of blocks.
Each module has its own layout file that is in charge of updating that specific module layout. We need to start by creating a layout file for our module by following these steps:
Navigate to
app/design/frontend/base/default/layout/
.Create a file named
mdg_giftregistry.xml
.Add the following code (the file location is
app/design/frontend/base/default/layout/mdg_giftregistry.xml
):<layout version="0.1.0"> <mdg_giftregistry_index_index> </mdg_giftregistry_index_index> <mdg_giftregistry_index_new> </mdg_giftregistry_index_new> <mdg_giftregistry_index_edit> </mdg_giftregistry_index_edit> <mdg_giftregistry_view_view...