2

I am trying to override sign in and register link in magento 2. can any one please help me on this.

2
  • Can you be more specific, what do you want to override? It might be a simple xml solution
    – Vlad Patru
    Commented Dec 6, 2016 at 8:12
  • i want to make login and register popup.
    – rajat kara
    Commented Dec 6, 2016 at 8:35

1 Answer 1

2

The top.links can be overriten in defaul.xml of your theme something like:

<referenceBlock name="top.links">
    <block class="Magento\Customer\Block\Account\Link" name="my-account-link">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
        </arguments>
    </block>
    <block class="Magento\Customer\Block\Account\RegisterLink" name="register-link">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">Create an Account</argument>
        </arguments>
    </block>
    <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link"
           template="account/link/authorization.phtml"/>
</referenceBlock>

You can see that the AuthorisationLink has a template, you can edit that template to add the popup functionality, also for the "register-link" you can create a template and create desired functionality. Also for the popul functionality check Magento2 Modal component in the devdocs http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/widgets/widget_modal.html

1
  • i am creating one custom module and override the top.links to add popup.
    – rajat kara
    Commented Dec 6, 2016 at 8:51

Your Answer

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

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