cancel
Showing results for 
Search instead for 
Did you mean: 

Override a single core file with different module

SOLVED

Override a single core file with different module

Hi, My question is can I override a single core file with different modules and get both the result.

That is, I have created a custom module called "Filters", and I have overridden the create.phtml file(Create customer account).

 

customer_account_create:-

 

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_form_register">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mofosys_Registration::form/register.phtml</argument>
</action>
</referenceBlock>
</body>
</page>

 

register.phtml:-

<h1>Filter template Overided</h1>

 

 

I have created a custom module called "Registration", and I have overridden the create.phtml file(Create customer account) again.

 

customer_account_create:-

 

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_form_register">
<action method="setTemplate">
<argument name="template" xsi:type="string">Mofosys_Registration::form/register.phtml</argument>
</action>
</referenceBlock>
</body>
</page>

 

register.phtml:-

<h1>Registration template Overided</h1>

 

When i go to Customer create (customer/account/create/ ) page, can I get both the overridden results in the Registration page?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Override a single core file with different module

Hello @raju_a 

 

It will show only module file content.

 

If you need both then you need to create child block and you need to assign it

 

Hope it will help you.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

1 REPLY 1

Re: Override a single core file with different module

Hello @raju_a 

 

It will show only module file content.

 

If you need both then you need to create child block and you need to assign it

 

Hope it will help you.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer