0

I'm working on a Magento 2.2.9 website that somebody has already built before me. I'm trying to change the layout for the Home page and I'm really confused about which file I should be editing. I've found that the layout will be either in default.xml or in cms_index_index.xml.

Here is the location of my default.xml:

/home/folder/site.com/html/app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml

Here is the content of the 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="head.additional">
        <block class="Infortis\Cgen\Block\AssetWrapper\Combined" name="head.additional.asset-wrapper" template="assets/wrapper/combined.phtml">
            <arguments>
                <argument name="asset_name" xsi:type="string">cfg.css</argument>
                <argument name="asset_id" xsi:type="string">iult</argument>
            </arguments>
        </block>
    </referenceBlock>    
</body>

Here is the location of my cms_index_index:

/home/a2b89dbe/westhort.com/html/vendor/magento/module-cms/view/frontend/layout/cms_index_index

Here is the content of my cms_index_index:

<?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" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body/>
</page>

So, my guess is that the Home page configuration is in file urn:magento:framework:View/Layout/etc/page_configuration.xsd but I couldn't find it. Does anybody know where this file can be? Is there any other way to know how my Home page is configured?

1

Please reading controller: \Magento\Cms\Controller\Index\Index to know how to prepare & render Home Page.

In configuration, you can see value of field CMS Home Page. It determines 'Cms Page' which page will be the home page. So, let's check Cms Page "Home Page" to edit you site. Hope it will help you.

enter image description here

| improve this answer | |
  • I've found the controller in /home/folder/site.com/html/vendor/magento/module-cms/Controller/Index/Index.php but couldn't get any info from there about the location for Home page layout file. – in43sh Mar 3 at 18:13
  • In the Admin I've found CMS Home Page which is called "Ultimo Home Page 1". The problem is that I have 8 Ultimo Home pages and I also have 8 demo.xml files (demo1.xml, demo2.xml, demo3.xml, etc.), and when I search for "Ultimo Home Page 1" it finds it in every demoN.xml file so 8 instances. And I'm not sure which one is being used for the Home page. I'm assuming it's demo1.xml, but I have no proof for that. – in43sh Mar 3 at 18:17
  • @in43sh, You should see content of "Ultimo Home Page 1" page to know more. Then find something by identifier of page. Example: Identifier of Ultimo Home Page 1 is "ultimo-home-page-1" – Nguyễn Hoàng Tuấn Mar 4 at 9:28
  • I've found it, thank you very much. I was doing it wrong because I was looking at the content of "Home" page not "Ultimo Home Page 1". Though I have a question: how do you find the page identifier? – in43sh Mar 4 at 18:17
  • :D Identifier of the page? It's the url. – Nguyễn Hoàng Tuấn Mar 5 at 2:29

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.