i want to add a custom side bar phtml file in the home page that would show specific categories. i couldn't find a specific layout or template file for the homepage. any ideas?

2 Answers 2


Magento 2: How to override Luma Theme Home Page

here you can find the details hope this helps if helps accept as answer

  • did not help at all
    – Kames Guen
    Nov 16, 2019 at 20:59

to answer my question: first, the homepage like many other pages(ex: footer) are CMS pages, meaning that they are created and used by the admin, meaning that they don't have a particular layout or template or block files. 1-if you want to change the layout to 2-columns-left for example, you can either do it the admin panel or like I did edit the row in the database with installData:

$setup->updateTableRow('cms_page', 'page_id', '2', 'page_layout', '2columns-left');

2- next you want to create your sidebar template and it's the corresponding block in your custom module. 3- finally in your custom theme in


add this:

        <referenceContainer name="page.wrapper">

            <referenceContainer name="columns">
                <container name="div.sidebar.main" htmlTag="div" htmlClass="sidebar sidebar-main" before="main">
                    <container name="sidebar.main" as="sidebar_main" label="Sidebar Main">
                        <block class="vendore\module\Block\SideBar"

and like this you can a custom side bar in your home page

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.