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.
精彩评论