我想在我网站的每个页面内容的顶部显示一个轮播和两个横幅。我从 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 中放置一个块时,它不会全部显示。我想我在块类型参数上做错了,但我不知道是什么:有人可以帮我吗?谢谢。