There is a new move node in the layout XML that we have access to in M2. This node sets the declared block or container element as a child of another element in the specified order.
Example:
<move element="name.of.an.element" destination="name.of.destination.element" as="new_alias" after="name.of.element.after" before="name.of.element.before"/>
In the example you provided before you should just be able to call:
<move element="store.settings.language" destination="header.container" as="store_settings_language"/>
More information in the official M2 docs on <move>
here: https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv
In my previous experience with one of my client same (near to) requirement.
Header links needed before minicart without default message, so I'm sharing my experience matching your's requirement.
Link(s) on right side of minicart.
In your theme folder add below code in below file :
Magento_Customer/layout/default.xml
or
Magento_Theme/layout/default.xml
1. Move Sign-In Link next to minicart
<!-- move minicart next to search block -->
<move element="minicart" destination="header-wrapper" after="top.search"/>
<!-- move sign-in link next to minicart block -->
<move element="authorization-link-login" destination="header-wrapper" after="minicart"/>
2. Move All top Header Links next to minicart
<!-- header default welcome message if want to remove -->
<referenceBlock name="header" remove="true" />
<!-- Keep minicart next to search block -->
<move element="minicart" destination="header-wrapper" after="top.search"/>
<!-- Move top All Header Links next to minicart -->
<move element="header.links" destination="header-wrapper" after="minicart"/>
Note : LESS
/*
Magento default css of float:right for minicart needs to be removed, if we want keep
links on the right side.
Pt 1. is not mandatory but good to remove
*/
.minicart-wrapper {
float: right; // need to remove float right
}
Best Answer
Many thanks to Ronak who helped me with the answer but I thought I would expand it in case anyone gets an error like me.
First of all, make sure the first line of your Reference container in
default.xml
looks like this<container name="topbar.container" label="topbar" as="topbar" htmlTag="div" htmlClass="topbar">
Now got to your home.xml or whatever you call your main page layout and make sure the container you are trying to move to the top has a layout something like this
<container name="topbar.container" as="topbar_container" label="Page topbar Container" htmlTag="topbar" htmlClass="page-topbar" before="-"/>
now go back to your default.xml and input this anywhere inside of the body tags but outside of anything else.
<move element="topbar.container" destination="header.container" before="-"/>
Make sure your container name is the same on both pages or you will get a error or it just won't work, trust me it took me hours to work that out.