我的 local.xml 设置如下:
<cms_index_index translate="label">
<reference name="content">
<block name="promos" type="page/html" template="cms/promos/homepage.phtml" as="promos" />
<block type="page/html_wrapper" name="home.footer">
<action method="setElementClass"><value>l-two-col group</value></action>
<block type="page/html_wrapper" name="home.footer.main">
<action method="setElementClass"><value>l-main</value></action>
<block type="page/html" name="featured_products" template="catalog/category/favourites.phtml" as="featured_products" />
</block>
<block type="page/html_wrapper" name="home.footer.side">
<action method="setElementClass"><value>l-sidebar</value></action>
<block type="vertnav/navigation" name="catalog.vertnav" as="vertnav" template="vertnav/left.phtml">
<action method="setCategoryId"><category_id>3</category_id></action>
</block>
</block>
</block>
</reference>
</cms_index_index>
我在模块布局 xml 文件中有以下代码,它正确替换了“promos”块,但我无法让它对名为“featured_products”的块做同样的事情。
<cms_index_index translate="label">
<remove name="promos"></remove>
<reference name="content">
<block type="page/html" template="cms/promos/homepage-usa.phtml" as="promos" />
</reference>
</cms_index_index>
有谁知道我如何以与我已经为促销块所做的相同的方式替换 features_products 块?
我努力了:
<reference name="content">
<block type="page/html" template="cms/promos/homepage-usa.phtml" as="promos" />
<reference name="home.footer">
<reference name="home.footer.main">
<block type="page/html" name="featured_products1" template="catalog/category/favourites-usa.phtml" as="featured_products1" />
</reference>
</reference>
</reference>
提前致谢,
戴夫