Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Admin <adminhtml_customer_edit> layout handle problem ? 
 
shuks
Member
 
Total Posts:  42
Joined:  2010-07-21
 

Hello..

I have created a custom tab and page using the <adminhtml_customer_edit> layout handle. Everything works fine when editing an existing customer, however, when I go to create a NEW customer my custom tab and block show up and it somehow breaks that page and won’t let me create a new user.

I need to be able to display a custom block in the “customer edit” page but NOT on the “create cusomter” page.

Ive looked at the customer.xml file in app/design/adminhtml/default/default/layout/customer.xml and I don’t see a way around this problem ?

Does anyone know of the correct layout handle to do this ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
shuks
Member
 
Total Posts:  42
Joined:  2010-07-21
 

Thanks Monty22 !

Ya, that is exactly right. I figured this out not long after posting. Hopefully this will help someone else with the same problem.

The trick was in the canShowTab() method :

public function canShowTab()
    
{
        
if (Mage::registry('current_customer')->getId()) {
            
return true;
        
}
        
return false;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top