1

I am currently using a extension and i would like to add some codes to it to override the notification bar that usually shows up under the header. based on my checks, the file that displays this is...

/design/adminhtml/default/default/template/notification/toolbar.phtml

i tried adding the following code to my extension's layout xml file but it didn't work!

<reference name="notifications">
<action method="setTemplate">
<template>extension-folder/notification/toolbar.phtml</template>
</action>
</reference>

i checked adminnotification.xml file and i realized it had this code:

<layout>
    <default>
        <reference name="notifications">
            <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
        </reference>
        <reference name="notifications">
            <block type="adminhtml/notification_window" name="notification_window" as="notification_window" acl="system/adminnotification/show_toolbar" template="notification/window.phtml" />
        </reference>
    </default>
</layout>

so i decided to copy this section:

<reference name="notifications">
            <block type="adminhtml/notification_toolbar" name="notification_toolbar" as="notification_toolbar" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml" />
        </reference>

and paste it in my extension's xml file and modify the template section with my modified template location. This worked, displaying my modified notification toolbar, but somehow was now displaying 2 instances of it and i cant figure out why!

can anyone assist?

1

Never mind, i figured out what i was doing wrong!

the reference name i was using was incorrect. instead of using notifications i should have used notification_toolbar

if you look at the codes i posted for adminnotification.xml, there are 2 blocks under the same reference name. by using the block name instead, this tells the xml the specific block i'm trying to override, which solves the problem!

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.