4

So I have the in my category->Display Settings->Display Mode set to "Static block only"

And category->Design->Layout set to "1 column"

And category->Design->Layout Update XML

   <referenceContainer name="content">
     <referenceBlock name="sidebar.main" remove="true"/>
     <referenceBlock name="sidebar.additional" remove="true"/>
   </referenceContainer >

And sidebar.additional doesn't get removed, But what I notice is if I remove only one of them at time it works but I need to remove both.

What am I dong wrong with the xml updated?

Any help Please Appreciate.

4
  • if you have set 1 column layout, by default it should not display sidebar(left/right column)
    – Piyush
    Commented Nov 22, 2017 at 10:56
  • Do you have installed any theme in your magento? Commented Nov 22, 2017 at 11:14
  • @Piyush Yes that's what I thought but there might be a bug github.com/magento/magento2/issues/7765 Commented Nov 22, 2017 at 11:21
  • @ABHISHEKTRIPATHI Yes I do? Commented Nov 22, 2017 at 11:25

3 Answers 3

7

The only solution It worked for me was xml update by removing catalog.leftnav e.g

 <referenceContainer name="content">
     <referenceBlock name="catalog.leftnav" remove="true"/>
 </referenceContainer >
1
  • For me changing reference container to <referenceContainer name="sidebar.main"> has worked.
    – Gediminas
    Commented Aug 12, 2020 at 15:59
1

Just use

<referenceBlock name="sidebar.main" remove="true"/>
<referenceBlock name="sidebar.additional" remove="true"/>

without wrapping in <referenceContainer name="content"> and everything will work.

0

In case, i am suggesting to make Anchor field Value at Display Setting to NO .

,Bcoz by default at magento2Anchor field value is set As YES.

I have also check same scenario at magento 1.X.If you category has Products and Display Setting* to YES and Display setting is only static block.Then on left panel ,you will layer navigations and right section CMS static block.

3
  • setting isAnchor to= NO works for my Magento2.1.0 but does not work for 2.1.7 Commented Nov 22, 2017 at 13:46
  • have check the setting at store view scope?
    – Amit Bera
    Commented Nov 22, 2017 at 14:01
  • @ Amit Bera there are no store view set only the default. However when I set the isAnchor to =NO it's seen to display a diferent template layout with id="narrow-by-list2" when before was narrow-by-list Commented Nov 22, 2017 at 14:31

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.