We want to edit the Magento2 Luma header template, this so we can change the sort inside

<div class="header content">

We want to place the block search before the minicart for example and place the logo block inside a new <div>

Where can we find the right template files for this?

So to change this:

enter image description here

Into this:

enter image description here


create default.xml under app/design/frontend/PackageName/themeName/Magento_Theme/layout directory

  <move element="top.search" destination="header-wrapper" before="minicart"/>
         <referenceContainer name="header-wrapper">
             <container name="custom-block-container" htmlTag="div" htmlClass="custom.block.container" >
         <move element="logo" destination="custom-block-container" after="-"/>

Let me know if works. It is working into Luma theme my side.

  • Only the first line of your answer is required isn't it?
    – Ben Crook
    Jun 13 '18 at 15:43
  • In default luma theme, top search is displaying after minicart . Requirement is "We want to place the block search before the minicart for example"
    – MR.R DNATH
    Jun 13 '18 at 15:57
  • That's what this line does - <move element="top.search" destination="header-wrapper" before="minicart"/>. The other lines create a new container, move the logo and add a class which doesn't seem necessary.
    – Ben Crook
    Jun 13 '18 at 16:04
  • so, what is your solution?:)
    – MR.R DNATH
    Jun 13 '18 at 16:09
  • You have the solution already, <move element="top.search" destination="header-wrapper" before="minicart"/> on it's own should do the job as that moves the search to be before the minicart.
    – Ben Crook
    Jun 13 '18 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.