3

Does anybody know if there have been changes to the way XML files from custom themes are included in Version 2.3? I have a very simple XML file to modify the Magento Advanced Search page. The custom .phtml file works fine from my version 2.2 mod, but the XML file doesn't seem to work since the upgrade.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. 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">
    <head>
        <css src="css/AdvancedSearch.css" media="all and (min-width: 1px)" />
    </head>
    <body>
        <referenceBlock name="page.main.title" display="false" />
    </body>
</page>

The above is the custom XML file that worked fine in 2.2 but does not seem to work in 2.3. All it does is removes the pages title and includes a custom CSS file

EDIT---------------------------------------- I copied the above code into the core XML file at /vendor/magento/module-catalog-search/view/frontend/layout and it is working as expected. However it doesnt work from the custom theme, even though the .phtml is fine and it worked in 2.2. Is there a reason why custom theme XML files might not be included?

2
  • did you try <referenceBlock name="category_list_on_left" remove="true"/> ?
    – fmsthird
    Commented May 6, 2019 at 6:11
  • I will try that now and see what happens, but it doesn't include the CSS file either when I search through the page code. As above, this was all ok and worked perfectly in V2.2
    – Anthony
    Commented May 6, 2019 at 6:13

1 Answer 1

0

You can try like this:

<?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">
    <head>
        <css src="Vendor_Module::css/AdvancedSearch.css" media="all and (min-width: 1px)" />
    </head>
    <body>
        <referenceBlock name="page.main.title" remove="true" />
    </body>
</page>  
1
  • Thanks for the suggestion but this does not work either. Any idea if anything has changed between versions 2.2->2.3 that would effect this simple xml?
    – Anthony
    Commented May 6, 2019 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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