开发者

How to modify a category page using custom template and Custom Layout Update via admin

开发者 https://www.devze.com 2023-02-16 03:03 出处:网络
I have a custom template i created to display subcategories within a category.I would like allow the usage of this template script on a category by category basis by using an xml override in \"custom

I have a custom template i created to display subcategories within a category. I would like allow the usage of this template script on a category by category basis by using an xml override in "custom layout update" field. I do not want to modify the any of the .xml layout files to so as to able to apply this template only on particular categories via the admin.

/theme/template/catalog/category/list.phtml <-- my custom template script

So i am having issues coming up with the xml override to add this template script to content area via the "custom layout update" field in the category admin . This is what i have:

 <reference name="content">
 <action method="append">
            <block type="catalog/navigation" name="collectionlist" template="catalog/category/list.phtml" />
</append>

</reference>

All i get is a blank page on the category, and the following error in the apache error log:

[Thu Mar 10 00:32:48 2011] [error] [client 72.201.97.195] PHP Fatal error:  Call to a member function xpath() on a non-object in <server_path>/app/code/core/Mage/Core/Model/Layout.php on line 开发者_如何学编程154

Any ideas would be greatly appreciated.


I suspect you don't need to specify the append method.

<reference name="content">
    <block type="catalog/navigation" name="collectionlist" template="catalog/category/list.phtml" />
</reference>


Your XML is broken. Don't close an <action> with an </append>.

With this fixed, SimpleXML will be able to parse your layout again.

0

精彩评论

暂无评论...
验证码 换一张
取 消