【发布时间】:2012-03-11 09:21:50
【问题描述】:
我想在所有页面的右栏下添加我的自定义侧边栏。
请查看此链接:http://www.wildbuilder.com/images/Untitled-1-Recovered.png
(我用图片解释。)
迷你侧边栏中有特色产品。
我不想将迷你侧边栏包含在右栏中。右列旁边:)
我已经在 /catalog/product/ 文件夹中制作了 features-products.phtml。
我创建了 cms 块、featured_products 并输入了这段代码
{{block type="catalog/product_list" category_id="4" template="catalog/product/featured-products.phtml"}}
我像这样在 page.xml 中添加了代码。
<block type="core/text_list" name="content" as="content" translate="label">
<label>Main Content Area</label>
<block type="cms/block" name="featured_products">
<action method="setBlockId"><block_id>featured_products</block_id></action>
</block>
</block>
然后我在 /template/page/folde 的 2columns-right.phtml 中添加了代码。
像这样,
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices') ?>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col2-right-layout">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="main">
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
<?php //my slidebar ?>
<div style="float:right;width:92px;vertical-align:top;background-color:#000;margin:-766px 110px 0 0;">
<?php echo $this->getChildHtml('featured_products') ?>
</div>
但我的侧边栏没有显示。
我该怎么办???
请告诉我。
谢谢。
【问题讨论】:
-
你清除缓存了吗?
-
在执行以下代码之前删除
<?php echo $this->getChildHtml('featured_products') ?>行。 -
我更新了我的文章。请检查一下,我总是在编辑我的代码后清除缓存。