3

I want to create 3 column page layout and want to call three static blocks into that page. Like

One block to add static data in main content area section,

second block to add data in left side area, and

third one to add data in right side area.

So what should i declare in custom layout file. Like i have declared layout=3columns but when i add anything into body section then it will be added to left side area only. How can i use all these three blocks in 3-column.

Thanks in advance.

3

Ok, After some research i got the final solution. I just need to add 3 reference containers mentioned below and have to add my static blocks inside those.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="3columns" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">    
     <body>
        <referenceContainer name="sidebar.main">
            <block class="Magento\Framework\View\Element\Template" name="simple.block1" template="VENDOR_MODULE::test1.phtml"/>
        </referenceContainer>
        <referenceContainer name="content">
                <block class="Magento\Framework\View\Element\Template" name="simple.block2" template="VENDOR_MODULE::test2.phtml"/>
        </referenceContainer>
        <referenceBlock name="wishlist_sidebar" remove="true"/>
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
        <referenceContainer name="sidebar.additional">
            <container name="fsd" htmlTag="div">
                <block class="Magento\Framework\View\Element\Template" name="simple.block3" template="VENDOR_MODULE::test3.phtml"/>
            </container>
        </referenceContainer>
    </body>
</page>
| improve this answer | |

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.