Book Image

Magento 2 Development Cookbook

Book Image

Magento 2 Development Cookbook

Overview of this book

With the challenges of growing an online business, Magento 2 is an open source e-commerce platform with innumerable functionalities that gives you the freedom to make on-the-fly decisions. It allows you to customize multiple levels of security permissions and enhance the look and feel of your website, and thus gives you a personalized experience in promoting your business.
Table of Contents (13 chapters)
12
Index

Adding layout updates


In the previous recipe, we created a page without content. In this recipe, we will modify the content of that page with layout updates.

With layout updates, we can arrange the structure of the page as we have seen in the Customizing the HTML output recipe of Chapter 3, Theming. But here, we will see how we can do that in a module.

Getting ready

This recipe builds further on the previous recipe. You need the install the module that we created in the previous recipes of this chapter.

How to do it...

In the next steps, we will see how we can modify the block layout with our module:

  1. Create the app/code/Packt/HelloWorld/view/frontend/layout folder.

  2. In this folder, create a file called default.xml with the following content:

    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="footer_links">
      ...