3

I would like to know how to add the login form to the homepage in Magento 2.1.9

1 Answer 1

6

Please add below code to your layout update xml part of your home page in admin panel or in your cms_index_index.xml of your theme.

<referenceContainer name="content">
        <!-- customer.form.login.extra -->
        <container name="customer.login.container" label="Customer Login Container" htmlTag="div" htmlClass="login-container">
            <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="form/login.phtml">
                <container name="form.additional.info" as="form_additional_info"/>
            </block>
        </container>
        <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
            <arguments>
                <argument name="triggers" xsi:type="array">
                    <item name="loginButton" xsi:type="string">.action.login</item>
                </argument>
            </arguments>
        </block>
    </referenceContainer>
1
  • @chekhovana If its help you , Please accept answer.
    – Yogesh
    Sep 21, 2017 at 5:28

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.