cancel
Showing results for 
Search instead for 
Did you mean: 

Move Search Bar - Mag 2.2.3

Move Search Bar - Mag 2.2.3

I'm trying to move the search bar next to the logo on our website but not having any luck.

 

My theme is based on magento luma.

 

I have the below code

 

 <move element="block.search" destination="header.wrapper" after="logo" />

inside of

 

mytheme/theme/layout/default.xml

but the changes aren't being reflected.

 

Top-Search.PNG

 

code.png

 

 

I've inspected the code and tried different block names but changes still aren't being reflected.

 

For example

 

 <move element="block.block.search" destination="header.content" after="logo" />
5 REPLIES 5

Re: Move Search Bar - Mag 2.2.3

Hi @callam_kidsaw

 

try below code to move search-box after logo :

 

<move element="top.search" destination="header.wrapper" after="logo"/>

 

if issue solved,Click Kudos & Accept as Solution

Re: Move Search Bar - Mag 2.2.3

Hi @Manthan Dave

 

That is what I currently have in my default.xml but the change isn't being reflected..

 

I have flushed the cache, pub/static and view_processed folders but it still hasn't moved?

Re: Move Search Bar - Mag 2.2.3

Hi @callam_kidsaw

 

I think your file location is not correct , kindly put your file on below location.

 

app/design/frontend/Your_Vendor_Name/Your_Theme_Name/Magento_Theme/layout/default.xml

 

then clear the cache and check for the same

if issue solved,Click Kudos & Accept as Solution

Re: Move Search Bar - Mag 2.2.3

@Manthan Dave

 

Thanks, that has kind of worked.. but now the search bar has just completely disappeared?

 

When I right click the page and inspect, the search bar class isn't showing in the code?

 

search-gone.png

Re: Move Search Bar - Mag 2.2.3

Hi @callam_kidsaw

 

if you just wanted to move searchbox beside the logo , you need to change its css.

 

there is one class called - block-search

 

you need to override this in your css and  instead of float : right , you need to write float : left in it.

 

that will move your searchbox to exact beside the logo.

if issue solved,Click Kudos & Accept as Solution