I have created my custom module for specific customer group. so, admin will send link to customer to download some matter after login.

The login URL and login screen will be different for normal customer and specific customer group.

I have created the Module, but now how I can call the customer lgoin form on my custom URL action?

Could anyone help me out this issue?

1 Answer 1


You need to create layout handle to call login form in your custom module url

For ex. your routes.xml like


<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route frontName="test" id="test">
            <module name="Vendor_Module"/>

Your Controller like



namespace Vendor\Module\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action

    protected $resultPageFactory;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;

    public function execute()
        return $this->resultPageFactory->create();

Then create test_index_index.xml to handle test url and call login from


<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="content">
           <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\Customer\Block\Form\Login\Info" name="customer.new" template="newcustomer.phtml"/>
  • Thanks it's working fine as expected. But my login page is already override by the Magepalaza Social extension. So how I can override the login page on my custom login page? Please help. Jun 14, 2017 at 9:04
  • 1
    yes you can override after override by megaplaza social extension. i have done it . Jun 19, 2017 at 10:24

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.