Mangento 2 search result page sidbar missing
You can find this layout file catalogsearch_result_index.xml
in your app/code
or app/design
directory first.
Try to run below command in your CLI that will return all files which named as catalogsearch_result_index.xml
in your Magento
find -type f -name 'catalogsearch_result_index.xml'
After running above command you can see following output in console.
./vendor/magento/module-msrp/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-advanced-search/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-layered-navigation/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-swatches/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-directory/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/google-shopping-ads/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-wishlist/view/frontend/layout/catalogsearch_result_index.xml
./vendor/magento/module-catalog-search/view/frontend/layout/catalogsearch_result_index.xml
./app/design/frontend/Vendor/Theme/Magento_CatalogSearch/layout/catalogsearch_result_index.xml
Here I can see only one file here from app/design
directory. You will also get same vendor files in result. But you need to check app/code
and app/design
files first. Here in my case I check below XML file first.
app/design/frontend/Vendor/Theme/Magento_CatalogSearch/layout/catalogsearch_result_index.xml
You need to check below lines are available there in your catalogsearch_result_index.xml
files or not ?
<referenceContainer name="sidebar.main" remove="true" />
<referenceBlock name="catalogsearch.leftnav" remove="true" />
<referenceContainer name="sidebar.additional" remove="true" />
If any single line available there in that layout files, please try to comment out that line and just clear and flush Magento cache, and then check you can get your sidebar back. Because in layout whenever we add remove="true" there then it will remove particular container or block.
Note : If you have any single line in your layout file then you just need to comment that line and need to clear Magento cache once. Then it will work same as default Magento.
Hope this will help you!
most likely this is because of the "sidebar" or "sidebar.additional" container has been removed from your theme layout.
In order to fix this issue, please follow the steps below:
Look for remove="true"
in the theme layout XML files
. For this you need to check out all these files in our theme in general:
app/design/frontend/ThemeVendor/themename/*/layout/*.xml
Remove or comment lines that look like this
<referenceContainer name="sidebar.additional" remove="true" />
or
<referenceContainer name="sidebar" remove="true" />
hope this will solve your issue