hot*_*ity 1 grid themes magento
尝试在local.xml文件中使用two_column_right模板让主页显示4列网格以显示项目.不幸的是,我正在为其他地方的目录页面指定三列网格:/
可能需要<update handle="four_column_grid" />在引用主页的标签下插入?
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<four_column_grid>
<reference name="product_list">
<action method="setColumnCount">
<count>4</count>
</action>
</reference>
</four_column_grid>
<three_column_grid>
<reference name="product_list">
<action method="setColumnCount">
<count>3</count>
</action>
</reference>
</three_column_grid>
<default>
<!-- Header -->
<reference name="header">
<action method="unsetChild"><name>welcome</name></action>
</reference>
<!-- Root -->
<reference name="root">
<action method="unsetChild"><name>breadcrumbs</name></action>
</reference>
<reference name="footer">
<!-- Remove all the other Magento links - "Site Map, Search Terms, Advanced Search, and Contact Us" -->
<!-- <action method="unsetChild"><name>footer_links</name></action> -->
</reference>
<!-- Right sidebar -->
<reference name="right">
<remove name="paypal.partner.right.logo"/>
</reference>
</default>
<catalog_category_default>
<update handle="three_column_grid" />
</catalog_category_default>
<catalog_category_layered>
<update handle="three_column_grid" />
</catalog_category_layered>
</layout>
Run Code Online (Sandbox Code Playgroud)
简短回答:您无法使用布局XML在CMS块的"内部"块上设置值.
当loadLayout()被调用动作控制器中,布局XML被处理时,所有的块被实例化,并且<action>节点被执行.但这些块尚未呈现.
当renderLayout()被称为块通过调用它们的渲染toHtml()方法.
如果块恰好是包含实例的cms/block(或cms/page){{block ...}}实例,则此块将在此时实例化.
此时,在请求流期间,所有布局XML <action>节点都已处理完毕.
实质上,您正在引用布局XML中尚不存在的块实例.
作为一种解决方法,您也可以使用布局XML将产品列表块添加到主页.缺点是您无法将其自由放置在CMS块的其他内容中.
<cms_index_index><!-- layout handle for the default homepage action -->
<reference name="content">
<block type="catalog/product_list" name="product_list">
<action method="setTemplate">
<template>catalog/product/list.phtml</template>
</action>
<action method="setCategoryId">
<catId>51</catId>
</action>
<action method="setColumnCount">
<count>4</count>
</action>
</block>
</reference>
</cms_index_index>
Run Code Online (Sandbox Code Playgroud)
当然,您不仅限于产品列表块.如果您需要将列表放在其他内容中,您可以使用布局XML广告将cms块添加到主页.
| 归档时间: |
|
| 查看次数: |
7271 次 |
| 最近记录: |