How to remove main page title “Create New Customer Account” from registration page?
-
12-05-2021 - |
Вопрос
I am needing to remove the main page title "Create New Customer Account" from the registration page.
I see everywhere that I need to add the line below somewhere but where?
<referenceBlock name="page.main.title" remove="true" />
Essentially I'd like to remove the following div from the page.
<h1 class="page-title">
<span class="base" data-ui-id="page-title-wrapper">Create New Customer Account</span> </h1>
</div>
Is this possible?
Решение
You can remove page title from layout file i.e customer_account_create.xml
Theme level:
create
app/design/frontend/{Package}/{my-theme}/Magento_Customer/layout/customer_account_create.xml
<?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">
<body>
<referenceBlock name="page.main.title" remove="true" />
</body>
</page>
Module level:
create:
app/code/{Vendor}/{Module}/view/frontend/layout/customer_account_create.xml
<?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">
<body>
<referenceBlock name="page.main.title" remove="true" />
</body>
</page>
Другие советы
You need to override layout file in your custom theme with below code
app/design/frontend/Vendor/yourtheme/Magento_Customer/layout/customer_account_create.xml
<?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">
<body>
<referenceBlock name="page.main.title" remove="true" />
</body>
</page>