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

Breadcrumbs & Account
 
seldon
Sr. Member
 
Total Posts:  92
Joined:  2007-11-08
 

Im trying to implement breadcrumbs on the accountpages. To do so, i overrode the customer/account block and added this method:

public function _prepareLayout(){

         
if ($breadcrumbs $this->getLayout()->getBlock('breadcrumbs')){
            $breadcrumbs
->addCrumb('home', array('label'=>__('Home'), 'title'=>__('Go to Home Page'), 'link'=>Mage::getBaseUrl()));
            
$breadcrumbs->addCrumb('account', array('label'=>'Account''title'=>'Account'));
         
}
    }

Then i added this ‘empty’ block to the custome_account section. This block however, has no template and no real function, other then setting the breadcrumb. It is actually thus more like a helper. Therefore I wonder if this is the nicest way to implement it. Any ideas Magento team ?

Actually this is done too in the category view block. A ‘helper’ block is created to set the breadcrumbs. Is this the good way to go? Wouldnt it be nicer if this code moved to a (view) helper?

Thnx,

Seldon

 
Magento Community Magento Community
Magento Community
Magento Community
 
seldon
Sr. Member
 
Total Posts:  92
Joined:  2007-11-08
 

Hmm, on second thought, a block is actually a view helper, so in that sense it is ok to add a helper block, though perhaps it is not nice to add it via the main.xml since it has no templating/output functionality.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top