I need to add some content to the top of the images tab in the catalog product edit view. I do not want to add a new tab, i want to include some content (custom block) to the existing one.

I have seen a lot of tutorials on how to add a whole new tab, but nothing on how to edit an existing one.

I have managed to create an observer on the event "core_block_abstract_prepare_layout_after":


and remove and recreate the tab in the same position:

public function editImagesTabs(Varien_Event_Observer $observer) {
    $block = $observer->getEvent()->getBlock();

    if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs) {

                'label'     => 'Upload Product Files',
                'content'   => $block->getLayout()->createBlock('adminhtml/catalog_product_helper_form_gallery_content')->toHtml() . 'custom content'

Anyway, it seems that $block->getLayout()->createBlock('adminhtml/catalog_product_helper_form_gallery_content')->toHtml() is not enough to recreate the images tab.

Not sure if i'm going in the right direction.

Any hint would be greatly appreciated.

1 Answer 1


I've found another way to achieve my goal, here is what I did.

I have overridden the method toHtml() of the class "Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery" in that way:

class Custom_Module_Block_Adminhtml_Catalog_Product_Helper_Form_Gallery 
    extends Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery {

    public function toHtml() {

        $myBlock = Mage::getSingleton('core/layout')->createBlock('custom_module/custom_block')->toHtml();

        return $myBlock . parent::toHtml();

and added this in the config.xml file:


not sure if this is the best approach but it works.

Your Answer

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

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