我在/app/design/frontend/mytemplate/default/template/page/html/footer.cat.links.phtml添加布局塊在Magento
創建一個.phtml文件,這在時刻僅包含1個html div,其中包含一些文本。
我想把這個添加到頁腳,但我沒有玩過佈局xml。
所以,我打開了/app/design/frontend/mytemplate/default/layout/page.xml,並嘗試添加:
<block type="catalog/navigation" name="footer.cat.links" as="footerCatLinks" template="page/html/footer.cat.links.phtml" />
(類型爲 「目錄/導航」 因爲我打算要得到這個工作:http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/getting_and_using_categories_and_subcategories)
我把它只是頁腳塊像這裏面:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml"><my block here></block>
然後在footer.phtml,我試圖調用新的塊用:
<?php $this->getChildHtml('footerCatLinks') ?>
我刷新緩存等,但它不能在footer.cat.links添加HTML DIV。 phtml當我在瀏覽器中查看。
我終於認爲我是在Magento附近摸索了一下,但是從我對文檔的理解中,這應該起作用!我有多不對?
page.xml中圍繞您的塊標記的佈局處理是什麼? –