1

I want to change my page titles for categories but cannot find where it's originally set.

Right now, they look usually like this: Laptops - Computers - Electronics - Magento

But I cannot find the piece of code that lines up all the categories and seperates them with " - "

I expected it to be in

Mage_Page_Block_Html_Head

Or in

Mage_Catalog_Block_Category_View

Or maybe

Mage_Catalog_Model_Category

but it was nowhere to be found.

In Category_View the title gets only set when there is a title set in the backend:

if ($title = $category->getMetaTitle()) {
      $headBlock->setTitle($title);
}

but there's no else after that.

In Mage_Page_Block_Html_Head there is the method getDefaultTitle() which I'd expect to be called when no title has been set.

I am aware that I don't necessarily need to find that piece of code to change my title but it would certainly help to understand magento better.

For clarification: I am talking about meta-titles. I know how to set them. I want to know where they are set that they look like this: Laptops - Computers - Electronics - Magento

Thanks

1

It's located in Mage_Catalog_Block_Breadcrumbs.

This isn't the most obvious location but kind of makes sense as the breadcrumbs are displayed in a similar manner.

0

Not sure if is what you're looking for but in

app/design/frontend/default/YOUR_THEME/template/catalog/category/view.phtml

OR

app/design/frontend/BASE/default/template/catalog/category/view.phtml

is where gets the title for frontend with this code

<div class="page-title category-title">
    <h1><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1>
</div>
  • thanks but i'm talking about meta-titles. changed in original post – kilsen Oct 15 '14 at 23:05
  • Um, there's no <meta title="" />, only <title /> in the <head /> section. It's kind of embarrassing, all the people who ask about meta-title tags. Titles have always been a distinct part of the HTML page. Magento confuses the issue by having the Title in the meta tags section in Category and Product Maintenance. – Fiasco Labs Oct 16 '14 at 2:36
  • my mistake, sorry @user9855 – Natalie Oct 16 '14 at 20:29
0

Have a look in your theme or parent theme layout files you removed breadcrumbs block like this way

 <remove name="breadcrumbs" />

dynamic page title set from Mage_Catalog_Block_Breadcrumbs so you must use this block in your site to make page titles dynamic. If you don’t want to show breadcrumbs just keep the phtml file empty (/template/page/html/breadcrumbs.phtml)

Your Answer

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

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