Question:

how to override customer login.phtml file in custom module

Grace: 20 May 2022

I want to override Customer login form of core files. In customer/account/login xml file I already added my custom file path and override it , but still it is not working.

How can i override form/login.phtml file ?

please help me....

xml => customer_account_login.xml

<referenceBlock name="customer_form_login">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Name_Abc::form/login.phtml
                </argument>
            </action>
        </referenceBlock>

Answer:
Adrian: 20 May 2022

inside your customer_account_login.xml file,

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <container name="customer.login.container" before="customer_form_register" label="Customer Login Container" htmlTag="div" htmlClass="login-container">
                <block class="Magento\Customer\Block\Form\Login" name="customer_form_login" template="Name_Abc::form/login.phtml">
                    <container name="form.additional.info" as="form_additional_info"/>
                </block>
            </container>
        </referenceContainer>
  </body>
</page>