In my custom module, I want to add a custom link in the header, but not within the top links. I can't edit the header.phtml. I prefer add link through layout


2 Answers 2


The header block is not of type text_list which would automatically echo all of it's child blocks, therefor you have to manually specify each block that you want to output. In other words, you have to change the header.phtml template


You should add something in header.phtml because he can't render automatically all the blocks in content, but you can do it properly like this:


<reference name="header">
    <block type="core/template" name="new.link" template="page/html/header/link.phtml"/>


<a href="#">My new link</a>


<?php echo $this->getChildHtml('new.link') ?>

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.