我想在網站的每個頁面內容的頂部顯示一個輪播和兩個橫幅。 我已經創建了一個自page.xml中的頁腳塊開始的自定義引用。 因此,這是什麼樣子:爲Magento佈局中的靜態塊提供新參考
<block type="page/html" name="topcontent" as="topcontent" template="page/html/topcontent.phtml">
<block type="page/html_wrapper" name="topcontent.container" as="topcontentContainer" translate="label">
<label>Page Top Content</label>
<action method="setElementClass"><value>topcontent-container</value></action>
</block>
<block type="core/template" name="topcontent.book.carousel" as="topcontentCarousel" template="callouts/book-carousel.phtml"/>
<block type="core/text_list" name="topcontent.left" as="topcontentLeft" />
<block type="core/text_list" name="topcontent.right" as="topcontentRight" />
</block>
然後,我創建了這裏我把
<div class="topcontent-container">
<div class="topcontent">
<?php echo $this->getChildHtml('topcontentContainer') ?>
<?php echo $this->getChildHtml('topcontentCarousel') ?>
<?php echo $this->getChildHtml('topcontentLeft') ?>
<?php echo $this->getChildHtml('topcontentRight') ?>
</div>
</div>
我已經正確地顯示我的傳送帶用topcontent.phtml文件,但是當我試圖把塊topcontentLeft或topcontentRight,它不會全部顯示。 我想我做的塊類型參數錯了,但我不明白什麼:有人可以給我一些幫助嗎? 謝謝。
我已經試過了,但沒有解決問題。我認爲核心/模板需要一個.phtml模板才能工作。 – pasine 2011-01-13 16:35:39
是的,它應該與模板 – 2011-01-13 16:40:01