2

To add an html section on all pages of admin panel using a separate module i have created a sepetate layout customercare.xml

<?xml version="1.0"?>
<layout version="0.1.0">
 <reference name="footer">
    <block type="adminhtml/template" template="customercare/quickbox.phtml" name="footer_quick_box" as="footer_quick_box" />
</reference>
</layout>

I have added few texts in "customercare/quickbox.phtml" but its not showing on the any of the pages.

Extension config.xml file is

<?xml version="1.0"?>
<config>
    <modules>
        <My_Customercare>
            <version>0.1.5</version>
        </My_Customercare>
    </modules>
    <global>
        <helpers>
            <customercare>
                <class>My_Customercare_Helper</class>
            </customercare>
        </helpers>
        <blocks>
            <customercare>
                <class>My_Customercare_Block</class>
            </customercare>
        </blocks>
    </global>
    <adminhtml>
        <layout>
            <updates>
                <customercare>
                    <file>customercare.xml</file>
                </customercare>
            </updates>
        </layout>
    </adminhtml>
</config>

1 Answer 1

6

handle missing in your layout file.

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="footer">
            <block type="adminhtml/template" template="customercare/quickbox.phtml" name="footer_quick_box" as="footer_quick_box" />
        </reference>
    </default>
</layout>

And you need to add the below code in

root/app/design/adminhtml/default/default/template/page/footer.phtml

<?php $this->getChildhtml('footer_quick_box')?>

If you don't want edit any code phtml file, then use before_body_end

i.e.,

<?xml version="1.0"?>
<layout>
    <default>
        <reference name="before_body_end">
            <block type="adminhtml/template" template="customercare/quickbox.phtml" name="footer_quick_box" as="footer_quick_box" />
        </reference>
    </default>
</layout>

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.