Search code examples
magentoblocktitlemetahead

custom head block is not fetching page title and meta data


I have built a custom 'head' block on my Magento store, which only includes the neccessary scripts and files which I use throughout the site. For the sake this question lets call it 'new_head'. Only when the user is on a system page; checkout, login/lout, my account etc..., does the native 'head' block get used.

This works amazingly so far, but my problem is now the page title and meta data are displaying default values on every single page - "Magento Enterprise Edition"

Obviously this is no good. All of the original "echo" statements are in my 'head.phtml' file:

<title><?php echo $this->getTitle() ?></title>
<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()) ?>" />

I know the cause of the problem, and this is because I am not calling the native 'head' block reference in my templates, and I suspect somewhere in the layout or the core files there is a reference to 'head' to fetch the above values.

So my question is: where in Magento can I set the above values to point to both the native 'head' block reference and my custom 'new_head' block reference?


Solution

  • Problem solved. Don't use a custom head.