nick501414
nick501414

Reputation: 129

Need Magento Help - Title tags not working

I am having problems with my magento site. I am not the only developer that has worked on it and am really confused by the problem as I do not use Magento much.

The problem is the title tag for all of my pages and products is exactly the same - it is what I have entered into config > design > html head > default title. Eg - 'welcome to blabla' If I remove what is in default title, then no title tag at all is displayed.

I have given all of my products meta titles that I want used... but it is not picking them up.

My head file has not been altered and shows:

<title><?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?></title>
<meta http-equiv="Content-Type" content="<?php $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?>" />
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />

If I change title to something like test, it does pick up the change, so my head file is working.

Really need some help with this. I am on version 1.4.2 and cant really upgrade.

Thanks!

Upvotes: 0

Views: 1759

Answers (1)

Anthony Raymond
Anthony Raymond

Reputation: 183

I think you might have the wrong echo statement in that snippet. Right now, it is trying to render the block with a name of 'breadcrumbs'. If that block only contains one title, then it would show up with one title on all pages.

Maybe try replacing this:

<title><?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?></title>

With this:

<title><?php echo $this->getTitle() ?></title>

Upvotes: 1

Related Questions