What you should be able to do is using the following xml set the template of the view tab:
<adminhtml_customer_edit>
<reference name="customer_edit_tab_view">
<action method="setTemplate">
<template>your/template/file.phtml</template>
</action>
</reference>
</adminhtml_customer_edit>
You'll need to do a little detective work. It's very possible a different change is responsible for the error you're seeing, or that something about your replacement triggers this error.
To start, I'd remove any custom functions you have in Mymodule_Customer_Block_Adminhtml_Customer_Edit_Tab_View
and concentrate on getting the class rewrite working without a Wrong tab Configuration
exception — that way if the error is tied to a method you've added, you'll know which one when you add your methods back one by one.
The exception you're seeing comes from this method
#File: app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php
public function addTab($tabId, $tab)
{
if (is_array($tab)) {
$this->_tabs[$tabId] = new Varien_Object($tab);
}
elseif ($tab instanceof Varien_Object) {
$this->_tabs[$tabId] = $tab;
if (!$this->_tabs[$tabId]->hasTabId()) {
$this->_tabs[$tabId]->setTabId($tabId);
}
}
elseif (is_string($tab)) {
if (strpos($tab, '/')) {
$this->_tabs[$tabId] = $this->getLayout()->createBlock($tab);
}
elseif ($this->getChild($tab)) {
$this->_tabs[$tabId] = $this->getChild($tab);
}
else {
$this->_tabs[$tabId] = null;
}
if (!($this->_tabs[$tabId] instanceof Mage_Adminhtml_Block_Widget_Tab_Interface)) {
throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));
}
}
else {
throw new Exception(Mage::helper('adminhtml')->__('Wrong tab configuration.'));
}
if (is_null($this->_tabs[$tabId]->getUrl())) {
$this->_tabs[$tabId]->setUrl('#');
}
if (!$this->_tabs[$tabId]->getTitle()) {
$this->_tabs[$tabId]->setTitle($this->_tabs[$tabId]->getLabel());
}
$this->_tabs[$tabId]->setId($tabId);
$this->_tabs[$tabId]->setTabId($tabId);
if (is_null($this->_activeTab)) $this->_activeTab = $tabId;
if (true === $this->_tabs[$tabId]->getActive()) $this->setActiveTab($tabId);
return $this;
}
And occurs when Magento can't instantiate a tab from information passed into addTab
. My guess is your error comes from this bit of layout XML in catalog.xml
<action method="addTab"><name>customer_edit_tab_view</name><block>customer_edit_tab_view</block></action>
Although adding some temporary debugging to the addTab
method above will help with that
var_dump($tabId, $tab);
If that's the case, it sounds like Magento may be having trouble instantiating your new block class. I'd try running the following code
$block = new Mymodule_Customer_Block_Adminhtml_Customer_Edit_Tab_View;
var_dump($block);
$block = Mage::getSingleton('adminhtml/customer_edit_tab_view');
var_dump($block);
and looking for instantiation errors (each call should return a block object).
My best guess as to why this is happening is you have your View.php
file for Mymodule_Customer_Block_Adminhtml_Customer_Edit_Tab_View
created in the wrong folder.
Good luck!
Best Answer
You could customize the template
catalog/product/view/attributes.phtml
. Copy it to your theme frombase/default
if it isn't there yet and include what you need.For better maintainability, I'd recommend to just add
$this->getChildHtml('my_child_alias')
to the template and define child blocks in the layout (i.e.layout/local.xml
of your theme: