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 (18 chapters)
Magento 2 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing a page title


Changing a page title helps you to improve the SEO of your website. For product pages, we can manage that with the backend but on other pages, such as the contact page, we can't do that.

In this recipe, we will change the page title of the contact page that is available at the /contact path.

How to do it…

To change the page title of the contact page, have a look at the following steps:

  1. Go to the contact page in the frontend. This is available at the path /contact.

  2. You see that the page title is set to Contact Us. We will change this to Give us a message.

  3. Create the file contact_index_index.xml in the folder app/design/frontend/Packt/cookbook/Magento_Contact/layout. If that folder doesn't exist, create it.

  4. In the contact_index_index.xml file, paste the following content:

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