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

1 Answer 1


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 class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                <argument name="triggers" xsi:type="array">
                    <item name="loginButton" xsi:type="string">.action.login</item>
  • @chekhovana If its help you , Please accept answer.
    – Yogesh
    Commented Sep 21, 2017 at 5:28

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.