cancel
Showing results for 
Search instead for 
Did you mean: 

Code error in layout update xml

Code error in layout update xml

Hello,

I got a issue. My developer left with a error in this code. Who can help me? I et this message: Please correct the XML data and try again. Element 'body': This element is not expected. Expected is one of ( referenceContainer, container, update, move ). Line: 13

 

I need the body part. Who can help me? I use Magento 2

 

<referenceContainer name="main.content"> <block class="Magento\Cms\Block\Block" name="home-slider1" before="-"> <arguments> <argument name="block_id" xsi:type="string">deal_of_the_day</argument> </arguments> </block> <block class="Magento\Cms\Block\Block" name="block-bottom-home1"> <arguments> <argument name="block_id" xsi:type="string">block-bottom-home1</argument> </arguments> </block> </referenceContainer> <body> <attribute name="class" value="cms-home-style-1" /> </body>

1 REPLY 1

Re: Code error in layout update xml

By default in Category Layout Update in Backend, Body tag is not supported.

You have to keep only below part of xml in your category admin,

 

<referenceContainer name="main.content"> <block class="Magento\Cms\Block\Block" name="home-slider1" before="-"> <arguments> <argument name="block_id" xsi:type="string">deal_of_the_day</argument> </arguments> </block> <block class="Magento\Cms\Block\Block" name="block-bottom-home1"> <arguments> <argument name="block_id" xsi:type="string">block-bottom-home1</argument> </arguments> </block> </referenceContainer>

Save Category. Your error will remove from category.

 

If issue Solved, click Kudos/Accept as solutions.

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial