【发布时间】:2011-06-08 14:16:02
【问题描述】:
我想在我网站的每个页面内容的顶部显示一个轮播和两个横幅。 我从 page.xml 的页脚块开始创建了一个自定义引用。 这就是它的样子:
<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>
然后我创建了一个 topcontent.phtml 文件
<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>
我的轮播显示正确,但是当我尝试在 topcontentLeft 或 topcontentRight 中放置一个块时,它并没有全部显示。 我认为我在块类型参数上做错了,但我不知道是什么:有人可以帮我吗? 谢谢。
【问题讨论】:
标签: templates layout magento reference block