1

the TopLinks navigation does not show up at all in my template.

in page.xml I have

<block type="page/template_links" name="top.links" as="topLinks"/>

in block

<block type="page/html_header" name="header" as="header">

and in my header.phtml I have

<?php echo $this->getHtml('top.links') ?>

It does not show up at all, what else could have gone wrong?

3

I believe the getHtml function uses the alias from the as attribute, rather than the name. The template should therefore be:

<?php echo $this->getHtml('topLinks') ?>

Update: you should basically have something roughly along the lines of:

page.xml

<default>
    <block type="page/html_header" name="header" as="header">
        <block type="page/template_links" name="top.links" as="topLinks"/>
    </block>
</default>

page/html/header.phtml

<?php echo $this->getHtml('topLinks') ?>
3
  • hmm I tried this too but it didn't make any difference. The whole block doesn't load according to the inline hints. Is there some configuration I could have f*cked up? Installation is relativeley fresh So there is not much I have changed.
    – user980018
    Feb 22 '15 at 11:25
  • I updated my post a little. If this is basically what you have and it isn't appearing, the most likely issue is you need to clear your cache, the layout xml is cached. Feb 22 '15 at 11:48
  • This didn't work - cache is deactivated, cleared it nonetheless.. :-(
    – user980018
    Feb 22 '15 at 12:05

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.