1

I have a block which I can call by using the following in a CMS page's content:

{{block type="karl_catalog/supplier_product" supplier_id="1242" template="karl_catalog/supplier_product.phtml"}}

This gets a collection of products and spits them out of the page and is all working fine.

However, I am trying to use an observer to see when this is called as I need to add rel="next" and rel="prev" links to the header. I've tried using the controller_action_layout_generate_blocks_after observer, but I've been unable to find a way to determine if the block type matches the above block type (above).

$l = $observer->getEvent()->getLayout();
foreach ($l->getAllBlocks() as $block) {
    echo $block->getType();
}

The above code echo's the block types, but karl_catalog/supplier_product is not shown.

Any ideas how I can achieve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.