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":
<core_block_abstract_prepare_layout_after>
<observers>
<edit_images_tab>
<type>singleton</type>
<class>custom_module/observer</class>
<method>editImagesTab</method>
</edit_images_tab>
</observers>
</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) {
$block->removeTab('group_10');
$block->addTabAfter(
'group_10',
array(
'label' => 'Upload Product Files',
'content' => $block->getLayout()->createBlock('adminhtml/catalog_product_helper_form_gallery_content')->toHtml() . 'custom content'
),
'group_9'
);
}
}
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.