Magento – edit breadcrumb from block

To edit a breadcrumb from the block, you can simply do that :

class Adin_Sales_Block_Invoice_View extends Mage_Core_Block_Template
{

    private $_mainOrder;

    public function _prepareLayout()
    {
        if ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) {
            $breadcrumbs->addCrumb('All orders', array('label'=>$this->__('All my invoices'), 'title'=>$this->__('All my invoices'), 'link'=>$this->getUrl('sales/invoice/history')));
            $breadcrumbs->addCrumb('My order', array('label'=>$this->__('My invoices : order %s', $this->_mainOrder->getIncrementId()), 'title'=>$this->__('My invoices : order %s',$this->_mainOrder->getIncrementId()), ));
        }
        return parent::_prepareLayout();
    }

$_mainOrder is defined in the __contruct() function