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

4
  • could you please little clear, what actually you want because currently they are coming same as you required in luma theme 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
    – Rob Webqem
    Jul 25, 2017 at 5:01
  • try moving "store.links to store.menu" Jul 25, 2017 at 5:15
  • <move element="store.links" destination="store.menu" before="catalog.topnav"/> is not working for me / any ideas?
    – Rob Webqem
    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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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