我是Magento主題的新手,並且正在嘗試做一些基本的主題更改。如何將Magento top.links複製到頁眉和頁腳
我想在我的頁眉和頁腳中顯示相同的top.links菜單。
我加了塊頁腳中page.xml:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/template_links" name="top.links" as="topLinks"/>
,並添加以下代碼到footer.phtml
<?php echo $this->getChildHtml('topLinks') ?>
這樣的菜單在頁腳顯示出來後,但不再在標題中。我猜一個塊只能顯示一次?我如何在頁眉和頁腳上顯示它?
謝謝。
您可以在不使用xml的情況下調用它。只需在頁腳頁面中調用<?php echo $ this-> getChildHtml('topLinks')?>。 –
@ K-THIHA - 我嘗試過,但沒有奏效。只是在DIV內沒有任何東西。 – user2766838