1

I'm trying to add one new template to customer account edit page using code below in my layout file

<customer_account_edit>
    <reference name="customer_edit">
        <block type="redbox/customer" name="linkedin_profile" template="redboxDigital_linkedin.phtml"/>
    </reference>
</customer_account_edit>

I want to include my template content above change password & Save button. How I can do that? I know I can over-write edit.phtml and add my code there but I don't prefer it.

2 Answers 2

3

Follow bellow steps

Step : 1 Add bellow code in your module layout file

app\design\frontend\your_package\your_theme\layout\your_layout_file.xml

OR

app\design\frontend\your_package\your_theme\layout\local.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_account_edit translate="label">
        <reference name="customer_edit">
            <block type="redbox/customer" name="linkedin_profile" as="linkedin_profile" template="redbox/linkedin.phtml"/>
        </reference>
    </customer_account_edit>
</layout>

Step : 2 add bellow child block in file

app\design\frontend\your_packge\your_theme\template\customer\form\edit.phtml

<?php echo $this->getChildHtml('linkedin_profile');?>
1
  • That helps. Isn't it possible to inject my template without modifying customer\form\edit.phtml at all ?
    – amitshree
    Feb 6, 2016 at 9:53
2

It is possible to add your template file without modifying customer\form\edit.phtml. You have to use <update handle="customer_account_edit" /> in your layout file by specifying after="" or before="" for your template. you need to give alias in customer.xml file for that block.

Thanks

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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