3

I need to wrap all my content in a div. I'm trying to add a container w/o any success. I created a child theme and a custom-home.xml config file as follow:

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<update handle="empty"/>

    <container name="panel" as="panel" label="panel" htmlTag="div" htmlClass="panel" htmlId="panel" after="body">
        <referenceContainer name="page.wrapper">
            <container name="ves-slideshow" as="ves-slideshow" label="Page Slideshow Container" htmlTag="div" htmlClass="ves-slideshow clearfix" before="main.content"/>
        </referenceContainer>
    </container>

</layout>

the container with name="panel" does not show up. What am I misunderstading?

3

I'm pretty sure you need to move the default container inside your new container.

I would try something like this:

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>

    <container name="panel" as="panel" label="panel" htmlTag="div" htmlClass="panel" htmlId="panel" after="body" />
    <move element="page.wrapper" destination="panel" /> 

    <referenceContainer name="page.wrapper">
        <container name="ves-slideshow" as="ves-slideshow" label="Page Slideshow Container" htmlTag="div" htmlClass="ves-slideshow clearfix" before="main.content"/>
    </referenceContainer>    
</layout>
  • 1
    how to wrap main content with custom div above it? – jafar pinjar Sep 26 '18 at 10:20

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.