I have developed a custom homepage layout and applied to the homepage. I've tried to add a created block in Magento_theme/templates/html/homepage.html but it is not displaying. Can anyone check problem in my code?

    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />

      <referenceContainer name="main.content">
          <block class="Magento\Framework\View\Element\Template" name="burgHomepage" template="Magento_Theme::html/homepage.phtml" />
  • Please show FUll XML code and where you added this – Manoj Deswal Jul 11 '17 at 9:03
  • You can create blocks and display them via widgets on homepage – Manoj Deswal Jul 11 '17 at 9:03
  • @ManojDeswal Updated now, sorry! I added it in my custom homepage layout magento_theme/page_layout/homepage.xml – Tom Jul 11 '17 at 9:04
  • why you are using body tag in between of code? – Manoj Deswal Jul 11 '17 at 9:09
  • @ManojDeswal I saw it on an answer on another question and I was just trying it, I can get my header and footer to show ok, in the middle it just says Home Page and my block doesnt show, do you know what I am doing wrong? – Tom Jul 11 '17 at 9:12

Create Your Custom Homepage in 4 Simple steps via admin only

1 ) Create a page For example custom-homepage Now you can directly put your content here and the go through with 4th step

2 ) For easy management of sections Create multiple blocks and put content which you want to display at homepage ex: home-block1 , home-block2

3 ) Call those block to your custom-homepage using below code

{{block class="Magento\\Cms\\Block\\Block" block_id="home-block1"}}
{{block class="Magento\\Cms\\Block\\Block" block_id="home-block2"}}

4 ) Now Final step to display your custom-homepage as main homepage

Admin > Stores > Configuration > General > Web > Default Pages > CMS Home Page

I hope this will make you work easy


| improve this answer | |

if you use Magento_Theme then your PHTML file should be located in


please check it , or in your theme app/design/YourPackage/YourTheme/ in this folder create directory Magento_Theme/templates/ and put your homepage.phtml in that folder

| improve this answer | |
  • Thank you, how would I then tell Magento to use this as my homepage? – Tom Jul 11 '17 at 9:47
  • @Tom your question is not clear to me – Murtuza Zabuawala Jul 11 '17 at 9:51

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.