i am trying the following code :
<referenceContainer name="page.top">
 <referenceBlock name="main_menu" remove="true" />
</referenceContainer>
in the DESIGN TAB> Layout Update XML in my page. but its not working.
my block's id is> 89 identifier is> main_menu and title is> Home 01- main menu. what else could i do to make this code work. basically, i want to remove this block from the homepage.
2 Answers 2
just hide it on home page.
check your body tag classes, there will be some unique class on home page body tag.
<body class="cms-home cms-index-index" >
</body>
by css you can hide it on only home page :)
- 
 can you tell me how and where to hide it? in which file?Laiba– Laiba2018年02月23日 12:15:43 +00:00Commented Feb 23, 2018 at 12:15
- 
 can you give some html snippet from that block, which you want to hide?Ganesh Godshelwar– Ganesh Godshelwar2018年02月23日 12:17:43 +00:00Commented Feb 23, 2018 at 12:17
- 
 <div class="main-menu menu-style-2">{{widget type="CleverSoft\CleverMegaMenus\Block\Widget\Megamenu" menu="main_menu"}}</div> <div class="zoo-customer-service text-right hidden-xs hidden-sm"> <p>Customer Service: <span style="font-weight: 600;"> (+xx) xxx- 7200-151</span></p> </div> thats the html used in this blockLaiba– Laiba2018年02月23日 12:19:01 +00:00Commented Feb 23, 2018 at 12:19
- 
 add in custom.css , body.cms-home div.main-menu.menu-style-2{display:none}Ganesh Godshelwar– Ganesh Godshelwar2018年02月23日 12:24:37 +00:00Commented Feb 23, 2018 at 12:24
- 
 i am anxiously waiting for your humble suggestion and solutionsLaiba– Laiba2018年02月23日 12:25:38 +00:00Commented Feb 23, 2018 at 12:25
Have you try not to reference the Container?
As I see here, a friend has remove the wishlist sidebar only with Block's reference.
- 
 yes @christoforos i've tried it and doing this shows me the following errorLaiba– Laiba2018年02月23日 12:06:19 +00:00Commented Feb 23, 2018 at 12:06
- 
 Please correct the XML data and try again. Element 'referenceBlock': This element is not expected. Expected is one of ( referenceContainer, container, update, move ). Line: 1Laiba– Laiba2018年02月23日 12:06:24 +00:00Commented Feb 23, 2018 at 12:06
- 
 Have you enable path hints (Enabled Template Path Hints for Storefront) and block hints (Add Block Names to Hints) in the admin interface? You will find them here: Stores > Configuration > Advanced > Developer > DebugChristoforos Kotsios– Christoforos Kotsios2018年02月23日 12:09:03 +00:00Commented Feb 23, 2018 at 12:09
- 
 maybe not. can you guid me how can i enable that setting?Laiba– Laiba2018年02月23日 12:09:43 +00:00Commented Feb 23, 2018 at 12:09
- 
 I edit the comment. Check in the path I add.Christoforos Kotsios– Christoforos Kotsios2018年02月23日 12:10:21 +00:00Commented Feb 23, 2018 at 12:10