0

Can I have two header.links blocks in the same default.xml file? So that one appears in the header-wrapper and the other in the store.menu

What I'm trying to do is have the join/register links in the header on desktop, but for mobile have them in the dropdown menu.

Cheers

asked Jul 25, 2017 at 3:33
4
  • could you please little clear, what actually you want because currently they are coming same as you required in luma theme Commented Jul 25, 2017 at 3:36
  • I'm using the blank theme / but in the theme (blank/luma) the "sign in" appears in the "Account" tab. I want it to appear in the menu tab only Commented Jul 25, 2017 at 5:01
  • try moving "store.links to store.menu" Commented Jul 25, 2017 at 5:15
  • <move element="store.links" destination="store.menu" before="catalog.topnav"/> is not working for me / any ideas? Commented Jul 25, 2017 at 23:13

1 Answer 1

0

I've fixed the issue with the following code in default.xml

<!-- Add elements to mobile dropdown menu -->
 <referenceBlock name="store.menu">
 <container name="nav-authorization" label="Nav Authorization" as="nav-authorization" htmlTag="ul" htmlClass="nav-authorization">
 <block class="Magento\Customer\Block\Account\AuthorizationLink">
 <arguments>
 <argument name="label" xsi:type="string">authorization</argument>
 </arguments>
 </block>
 <block class="Magento\Customer\Block\Account\RegisterLink">
 <arguments>
 <argument name="label" xsi:type="string">Register</argument>
 </arguments>
 </block>
 <block class="Magento\Customer\Block\Account\Link">
 <arguments>
 <argument name="label" xsi:type="string">My Account</argument>
 </arguments>
 </block>
 </container>
 </referenceBlock>
answered Jul 26, 2017 at 0:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.