Magento:类别描述后的显示块
我在将类别描述放在类别页面后面的块时出现问题。Magento:类别描述后的显示块
我有一个新的过滤导航分离布局的xml文件。 XML是:
<catalog_category_layered>
<remove name="catalog.leftnav" />
<remove name="enterprisecatalog.leftnav"/>
<reference name="left">
<block type="amshopby/catalog_layer_view" name="amshopby.navleft" after="currency" template="catalog/layer/view.phtml"/>
</reference>
<reference name="content">
<block type="amshopby/catalog_layer_view_top" name="amshopby.navtop" before="-" template="amshopby/view_top.phtml"/>
<block type="amshopby/top" name="amshopby.top" before="category.products" template="amshopby/top.phtml"/>
</reference>
</catalog_category_layered>
所以这是这行我的分类页面的内容区的开头放置块:
<block type="amshopby/catalog_layer_view_top" name="amshopby.navtop" before="-" template="amshopby/view_top.phtml"/>
所以现在我的分类页面看起来像这样:
已过滤的导航 - >分类标题 - >分类描述 - >产品概述
但我想重新排列它,使其看起来像
分类标题 - >分类描述 - >过滤导航 - >产品概览
但是我怎么能把这个块放在描述之后呢?这是一个新的块,其中包括标题,描述,产品等:
(标准的catalog.xml)
<catalog_category_layered translate="label">
<label>Catalog Category (Anchor)</label>
<reference name="left"></reference>
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/su.phtml</template></action> -->
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
<!-- The following code shows how to set your own pager increments -->
<!--
<action method="setDefaultListPerPage"><limit>4</limit></action>
<action method="setDefaultGridPerPage"><limit>3</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
<action method="addPagerLimit"><mode>grid</mode><limit>3</limit></action>
<action method="addPagerLimit"><mode>grid</mode><limit>6</limit></action>
<action method="addPagerLimit"><mode>grid</mode><limit>9</limit></action>
<action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action>
-->
</block>
<action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
<action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
</block>
</reference>
</catalog_category_layered>
我真的不知道如何将类别描述后添加此块。我是magento的新手,并且该系统很安静。我试过类似
<block type="amshopby/catalog_layer_view_top" name="amshopby.navtop" before="product_list_toolbar" template="amshopby/view_top.phtml"/>
但是这不起作用。我也尝试在catalog.xml中添加这个块代码,但没有显示。
有谁有一个想法,我能做些什么?感谢您的帮助!
在amshopby.xml
,切XML的下面几行:
<block type="amshopby/catalog_layer_view_top" name="amshopby.navtop" before="-" template="amshopby/view_top.phtml"/>
<block type="amshopby/top" name="amshopby.top" before="category.products" template="amshopby/top.phtml"/>
然后在catalog.xml
,贴上这两条线在这里:
<catalog_category_layered translate="label">
<!-- ... -->
<reference name="content">
<!-- ... -->
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<!-- paste XML here -->
<!-- ... -->
</reference>
</catalog_category_layered>
然后在template/catalog/category/view.phtml
贴在这条线:
<?php echo $this->getChildHtml('amshopby.navtop'); ?>
后以下内容:
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description std">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
<?php endif; ?>
应该这样做。
谢谢你的回答。但是当我尝试这个时,没有显示amshopby块。 没有错误,只是空的空间。 – Raisis
您是否在类别后面粘贴了这两行XML?产品'块?我已经为我正在使用改进导航模块的商店完成了这项工作,并且运行良好。 –
我会建议说,过滤器导航(又名分层导航)是左侧部分的一部分。你需要从左边删除它并在catalog.xml中的'content'部分内部添加找到' getCurrentCategory() - > getDescription()):?>'in'的magento /应用程序/设计/前端/碱/默认/模板/目录/类别/ view.phtml'。 如果条件调用'$ this-> getChildHtml('amshopby.navtop')''之后。 这应该工作。但有了经验,你将需要更多的调整 – SAM