I want to override page title of catalog pages to include selected attributes and subcategories.

e.g. "Shoes - Adidas - Red | Brand"

What observer or model should I override to modify the page title? And how can I get current category?

Thank you very much!

1 Answer 1


You can easily change the title of the page.

Get the block head and set the title e.g.

// app/code/core/Mage/Page/Block/Html/Head.php:388

The current category can be found here:


And the event to use? Good question. I would probably hook into core_block_abstract_to_html_before and check wether the block is Mage_Page_Block_Html_Head

public function changeTitle(Varien_Event_Observer $observer) {
    $block = $observer->getBlock();
    if($block instanceof Mage_Page_Block_Html_Head) {

You have to add a few more checks, e.g. you are on a category page or product page. And you have to check whether current_category exists.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.