0

My registration page is using a register.phtml located under certain path, which I know. But I don't know where the associated xml layout file is located, because it was already defined and I didn't do it.

But I want to use another .phtml file. My problem is that I am not able to find which layout is defining the .phtml that will be used. Or at least, the one it's supposed to be seems not to be the one that's being used.

I have been trying without success to obtain the layout that's being used. I tried using

<?php echo $this->getLayout()->getBlock('customer_form_register')->getXml(); ?>

and some similar things, but without success. I already activated from the admin the path and block hints.

I need to know which layout is defining the used register.phtml. Any help is much appreciated.

0

In customer.xml check the following handle :

<customer_account_create translate="label">
    <label>Customer Account Registration Form</label>
    <!-- Mage_Customer -->
    <remove name="right"/>
    <remove name="left"/>

    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
            <block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                <label>Form Fields Before</label>
            </block>
        </block>
    </reference>
</customer_account_create>
  • Indeed this handle is defined as you point out, but it seems that is being overwritten by another layout file. – LeCodeur Feb 22 '17 at 12:33
  • 1
    try to search customer_form_register in all custom layout files by using any editor if is there any reference for this block. – Prasanta Hatui Feb 22 '17 at 12:38
0

As per your comment if your register.phtml overwritten by another module then just put this code :

<?php echo Mage::app()->getRequest()->getModuleName(); ?> 

in your register.phtml and refresh the frontend this will tell you the module name find that module config file it will be locate in either app/code/local or app/code/community and then open the config.xml of that module it will be app/code/local/Namespace/Modulename/etc/ folder then open that file and find this node <layout> here you can get the xml file name

0

if you want set another phtml file you dont need to modify existing code

you can use setTemplate for override default template for that use below code in your themes local.xml file

<customer_account_create translate="label">
    <reference name="customer_form_register">
        <action method="setTemplate">
            <template>myphtmlPath/myphtml.phtml</template>
        </action>
    </reference>
</customer_account_create>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.