Mage_Page_Block_Html_Toplinks @deprecated after 1.4.0.1, CE 1.8
-
22-10-2019 - |
Question
I saw on RELEASE_NOTES.txt
on CE 1.8:
- Fixed #17451: Header Links (top.links.phtml) does not output correctly because it is using the model code (the Toplinks block is deprecated)
However, the $this->getChildHtml('topLinks')
call on the demo frontend template seems to output links which addLink
method of Mage_Page_Block_Html_Toplinks
created: shopping cart, login etc.
I didn't understand that. What is the supposed way of adding those links ?
Thanks.
Solution
Mage_Page_Block_Html_Toplinks
is indeed deprecated since 1.4.0.1. The new block for adding links is now Mage_Page_Block_Template_Links
, which also holds a addLink
method. If you check the page.xml you will notice the new block within the header block: <block type="page/template_links" name="top.links" as="topLinks"/>
.
So the functionality stays the same, although this new block is more a generic solution instead of just for the header top links.