12

I´m trying to remove the home page main title on my custom theme (wich is running on top of luma theme).

I´ve tried to add the usual tag to remove, as follows (and as it was already answered here), full content of my current cms_index_index.xml file:

<?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="page.main.title" remove="true"/>
    </body>
</page>

I´ve already tried other aproaches such as

<referenceBlock name="page.main.title" display="false"/>

And

<referenceBlock name="cms_page" display="false"/>

With no success either. Cache is being cleaned and files deployed. The cms_index_index.xml file i´m working in is located on folder

/app/design/frontend/<vendor>/<theme>/Magento_Cms/layout

What other options do i have? Why isn´t this aproach working?

  • 1
    Your code is definitely ok (the first code you tried) I've just tested it and it works fine on my side. I reckon your XML is not being picked up for some reason. Did you check the logs ? – Raphael at Digital Pianism Oct 27 '16 at 13:38
23

have you tried in cms_index_index.xml something like this?

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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>
  • 1
    Works fine for me – Siarhey Uchukhlebau Mar 22 '17 at 8:54
  • Yup, this is the way to go. If you want to remove it on a category page, for example you put this in catalog_category_view.xml file. And you can omit the layout attribute inside the <page> element. – Zankar Apr 9 at 7:43
3
  • Login to Admin
  • Goto Content->Element: pages->
  • Edit HomePage
  • Select Content
  • Remove Contet Heading and Save.
3

For all other Pages create cms_page_view.xml instead cms_index_index.xml

/app/design/frontend/<vendor>/<theme>/Magento_Cms/layout/cms_page_view.xml

And add same code you have used for cms_index_index.xml

<?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="page.main.title" remove="true"/>
    </body>
</page>
1
  • Check cms home page. content-> pages-> home page
  • than open that page and check that content heading is blank or not.

  • If it is not than remove heading. Now its removed form your front page

0

If your certain your XML is valid but not picked up by Magento, make sure that you check the table "theme" inside your Magento database.

The column "type" should have the value 0 (zero), for your theme.

If it is set to 1 (virtual) it will not pickup the overwrites that you defined inside your app/design custom theme folder.

Once you set it to 0, make sure that you clear all the cache, pub/static/frontend, var/view_preprocessed and re-check if your changes are now working.

0

Open homepage from Admin
Goto >> Design >> Layout Update XML add line

<referenceBlock name="page.main.title" remove="true"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.